From df047bc7499ca1f7b43a79cbe780e101a34cb3ad Mon Sep 17 00:00:00 2001 From: Timur Ercan Date: Thu, 9 Feb 2023 19:58:24 +0100 Subject: [PATCH 1/7] ui, ui button component fix --- packages/features/updateUser.ts | 32 +++++++++++------------- packages/ui/components/button/Button.tsx | 1 + 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/packages/features/updateUser.ts b/packages/features/updateUser.ts index 9075c4e94..a09793363 100644 --- a/packages/features/updateUser.ts +++ b/packages/features/updateUser.ts @@ -2,22 +2,18 @@ import toast from "react-hot-toast"; export const updateUser = async (user: any) => { if (!user) return; - toast - .promise( - fetch("/api/users", { - method: "PATCH", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(user), - }), - { - loading: "Saving Changes...", - success: `Saved!`, - error: "Changes could not save user :/", - } - ) - .then(() => { - // location.reload(); - }); + toast.promise( + fetch("/api/users", { + method: "PATCH", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(user), + }), + { + loading: "Saving Changes...", + success: `Saved!`, + error: "Changes could not save user :/", + } + ); }; diff --git a/packages/ui/components/button/Button.tsx b/packages/ui/components/button/Button.tsx index e0527d9a0..507dbf27d 100644 --- a/packages/ui/components/button/Button.tsx +++ b/packages/ui/components/button/Button.tsx @@ -35,6 +35,7 @@ export function Button(props: any) { ) : (