mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 21:39:49 +00:00
Refac move UserAccountType into loadUserAccount.ts
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user