mirror of
https://github.com/RYDE-WORK/full-stack-fastapi-template.git
synced 2026-01-27 01:03:43 +08:00
17 lines
710 B
TypeScript
17 lines
710 B
TypeScript
import { MainState } from './state';
|
|
|
|
export const getters = {
|
|
hasAdminAccess: (state: MainState) => {
|
|
return (
|
|
state.userProfile &&
|
|
state.userProfile.is_superuser && state.userProfile.is_active);
|
|
},
|
|
loginError: (state: MainState) => state.logInError,
|
|
dashboardShowDrawer: (state: MainState) => state.dashboardShowDrawer,
|
|
dashboardMiniDrawer: (state: MainState) => state.dashboardMiniDrawer,
|
|
userProfile: (state: MainState) => state.userProfile,
|
|
token: (state: MainState) => state.token,
|
|
isLoggedIn: (state: MainState) => state.isLoggedIn,
|
|
firstNotification: (state: MainState) => state.notifications.length > 0 && state.notifications[0],
|
|
};
|