Refac move UserAccountType into loadUserAccount.ts
This commit is contained in:
parent
d96ac486e4
commit
9a31c2d100
|
|
@ -1,5 +1,14 @@
|
|||
import APIClient from '../../functions/APIClient';
|
||||
import { UserAccountType } from '../../pages/Base';
|
||||
|
||||
export type UserAccountType = {
|
||||
id: number;
|
||||
name: string;
|
||||
is_superuser: boolean;
|
||||
is_staff: boolean;
|
||||
groups: [];
|
||||
user_permissions: [];
|
||||
last_login: string;
|
||||
};
|
||||
|
||||
const loadUserAccount = async (): Promise<UserAccountType> => {
|
||||
return APIClient('/api/user/account/');
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ import Navigation from '../components/Navigation';
|
|||
import { useAuthStore } from '../stores/AuthDataStore';
|
||||
import { useUserConfigStore } from '../stores/UserConfigStore';
|
||||
import { useUserAccountStore } from '../stores/UserAccountStore';
|
||||
import { UserAccountType } from '../api/loader/loadUserAccount';
|
||||
|
||||
export type TaUpdateType = {
|
||||
type TaUpdateType = {
|
||||
version?: string;
|
||||
is_breaking?: boolean;
|
||||
};
|
||||
|
|
@ -20,16 +21,6 @@ export type AuthenticationType = {
|
|||
ta_update: TaUpdateType;
|
||||
};
|
||||
|
||||
export type UserAccountType = {
|
||||
id: number;
|
||||
name: string;
|
||||
is_superuser: boolean;
|
||||
is_staff: boolean;
|
||||
groups: [];
|
||||
user_permissions: [];
|
||||
last_login: string;
|
||||
};
|
||||
|
||||
type BaseLoaderData = {
|
||||
userConfig: UserConfigType;
|
||||
userAccount: UserAccountType;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { create } from 'zustand';
|
||||
import { UserAccountType } from '../pages/Base';
|
||||
import { UserAccountType } from '../api/loader/loadUserAccount';
|
||||
|
||||
interface AccountState {
|
||||
userAccount: UserAccountType | null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue