From afdfb51e7c1bf9ba9d81efa553a17812fb62289a Mon Sep 17 00:00:00 2001 From: Christopher Arraya Date: Mon, 22 Jan 2024 17:47:50 -0500 Subject: [PATCH] fix (ui): shows correct toast when there is no error adding user to workspace --- components/workspace-settings.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/workspace-settings.tsx b/components/workspace-settings.tsx index d77c10c..130a0b8 100644 --- a/components/workspace-settings.tsx +++ b/components/workspace-settings.tsx @@ -48,7 +48,7 @@ export function WorkspaceSettings() { }), }); const res = await data.json(); - if (res.status === 200) { + if ((res.message = "Success!")) { toast({ variant: "default", title: "User added to workspace!", @@ -58,7 +58,7 @@ export function WorkspaceSettings() { toast({ variant: "destructive", title: "Uh oh! Something went wrong.", - description: res.error, + description: res.message, }); } } catch (err) { @@ -133,7 +133,7 @@ export function WorkspaceSettings() {
- + {email.slice(0, 2).toUpperCase()}