refactor(frontend): moved types to global types and successfull build
This commit is contained in:
@@ -1,17 +1,6 @@
|
||||
import {User} from "@/types/users";
|
||||
import {create} from "zustand";
|
||||
|
||||
type User = {
|
||||
user_id: string;
|
||||
email: string;
|
||||
username: string;
|
||||
roles: keyof Roles[];
|
||||
role: string;
|
||||
};
|
||||
|
||||
interface Roles {
|
||||
role: string;
|
||||
}
|
||||
|
||||
export type SessionState = {
|
||||
user: User | null;
|
||||
token: string | null;
|
||||
|
||||
@@ -1,17 +1,6 @@
|
||||
import {create} from "zustand";
|
||||
import {useSessionStore} from "./sessionStore";
|
||||
//import useSWR from "swr";
|
||||
|
||||
interface Modules {
|
||||
module_id: string;
|
||||
name: string;
|
||||
active: boolean;
|
||||
roles: string;
|
||||
add_user: string;
|
||||
add_date: Date;
|
||||
upd_user: string;
|
||||
upd_date: Date;
|
||||
}
|
||||
import {Modules} from "@/types/modules";
|
||||
|
||||
interface SettingState {
|
||||
userRoles: Modules[];
|
||||
@@ -23,7 +12,7 @@ interface FetchModulesResponse {
|
||||
data: Modules[];
|
||||
}
|
||||
|
||||
export const useModuleStore = create<SettingState>()((set) => ({
|
||||
export const useGetUserRoles = create<SettingState>()((set) => ({
|
||||
userRoles: [],
|
||||
setUserRoles: (userRoles) => set({userRoles}),
|
||||
fetchUserRoles: async () => {
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
import {Modules} from "@/types/modules";
|
||||
import {create} from "zustand";
|
||||
//import useSWR from "swr";
|
||||
|
||||
// interface Modules {
|
||||
// module_id: string;
|
||||
// name: string;
|
||||
// active: boolean;
|
||||
// roles: string;
|
||||
// add_user: string;
|
||||
// add_date: Date;
|
||||
// upd_user: string;
|
||||
// upd_date: Date;
|
||||
// }
|
||||
|
||||
interface SettingState {
|
||||
modules: Modules[];
|
||||
|
||||
Reference in New Issue
Block a user