fixed session bug

This commit is contained in:
Daniel
2023-05-21 13:24:42 +03:30
parent 0b1684442b
commit 22d8178c88
4 changed files with 28 additions and 13 deletions
+3 -2
View File
@@ -6,12 +6,11 @@
import { create } from "zustand";
import { User } from "@prisma/client";
import { AccountSettings } from "@/types/global";
import { useSession } from "next-auth/react";
type AccountStore = {
account: User;
setAccount: (email: string) => void;
updateAccount: (user: AccountSettings) => void;
updateAccount: (user: AccountSettings) => Promise<boolean>;
};
const useAccountStore = create<AccountStore>()((set) => ({
@@ -39,6 +38,8 @@ const useAccountStore = create<AccountStore>()((set) => ({
console.log(data);
if (response.ok) set({ account: data.response });
return response.ok;
},
}));