replaced email with username

This commit is contained in:
Daniel
2023-07-08 14:05:43 +03:30
parent 3993615071
commit 97ca682c0a
32 changed files with 283 additions and 117 deletions
+3 -3
View File
@@ -8,14 +8,14 @@ type ResponseObject = {
type AccountStore = {
account: AccountSettings;
setAccount: (email: string) => void;
setAccount: (username: string) => void;
updateAccount: (user: AccountSettings) => Promise<ResponseObject>;
};
const useAccountStore = create<AccountStore>()((set) => ({
account: {} as AccountSettings,
setAccount: async (email) => {
const response = await fetch(`/api/routes/users?email=${email}`);
setAccount: async (username) => {
const response = await fetch(`/api/routes/users?username=${username}`);
const data = await response.json();