small change
This commit is contained in:
parent
240d92aeae
commit
52159d8cde
|
@ -22,7 +22,7 @@ export default function () {
|
|||
setCollections();
|
||||
setTags();
|
||||
setLinks();
|
||||
setAccount(data.user.email as string, data.user.id);
|
||||
setAccount(data.user.email as string);
|
||||
}
|
||||
}, [status]);
|
||||
}
|
||||
|
|
|
@ -9,13 +9,13 @@ import { AccountSettings } from "@/types/global";
|
|||
|
||||
type AccountStore = {
|
||||
account: User;
|
||||
setAccount: (email: string, id: number) => void;
|
||||
setAccount: (email: string) => void;
|
||||
updateAccount: (user: AccountSettings) => Promise<boolean>;
|
||||
};
|
||||
|
||||
const useAccountStore = create<AccountStore>()((set) => ({
|
||||
account: {} as User,
|
||||
setAccount: async (email, id) => {
|
||||
setAccount: async (email) => {
|
||||
const response = await fetch(`/api/routes/users?email=${email}`);
|
||||
|
||||
const data = await response.json();
|
||||
|
|
Ŝarĝante…
Reference in New Issue