small change

This commit is contained in:
Daniel
2023-05-23 08:45:24 +03:30
parent 240d92aeae
commit 52159d8cde
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ export default function () {
setCollections(); setCollections();
setTags(); setTags();
setLinks(); setLinks();
setAccount(data.user.email as string, data.user.id); setAccount(data.user.email as string);
} }
}, [status]); }, [status]);
} }
+2 -2
View File
@@ -9,13 +9,13 @@ import { AccountSettings } from "@/types/global";
type AccountStore = { type AccountStore = {
account: User; account: User;
setAccount: (email: string, id: number) => void; setAccount: (email: string) => void;
updateAccount: (user: AccountSettings) => Promise<boolean>; updateAccount: (user: AccountSettings) => Promise<boolean>;
}; };
const useAccountStore = create<AccountStore>()((set) => ({ const useAccountStore = create<AccountStore>()((set) => ({
account: {} as User, account: {} as User,
setAccount: async (email, id) => { setAccount: async (email) => {
const response = await fetch(`/api/routes/users?email=${email}`); const response = await fetch(`/api/routes/users?email=${email}`);
const data = await response.json(); const data = await response.json();