Refac move UserAccountType into loadUserAccount.ts

This commit is contained in:
MerlinScheurer 2025-02-13 20:51:14 +01:00
parent d96ac486e4
commit 9a31c2d100
3 changed files with 13 additions and 13 deletions

View File

@ -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/');

View File

@ -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;

View File

@ -1,5 +1,5 @@
import { create } from 'zustand';
import { UserAccountType } from '../pages/Base';
import { UserAccountType } from '../api/loader/loadUserAccount';
interface AccountState {
userAccount: UserAccountType | null;