fix (ui): shows correct toast when there is no error adding user to workspace

This commit is contained in:
Christopher Arraya 2024-01-22 17:47:50 -05:00
parent 93c68014bf
commit afdfb51e7c

View File

@ -48,7 +48,7 @@ export function WorkspaceSettings() {
}), }),
}); });
const res = await data.json(); const res = await data.json();
if (res.status === 200) { if ((res.message = "Success!")) {
toast({ toast({
variant: "default", variant: "default",
title: "User added to workspace!", title: "User added to workspace!",
@ -58,7 +58,7 @@ export function WorkspaceSettings() {
toast({ toast({
variant: "destructive", variant: "destructive",
title: "Uh oh! Something went wrong.", title: "Uh oh! Something went wrong.",
description: res.error, description: res.message,
}); });
} }
} catch (err) { } catch (err) {
@ -133,7 +133,7 @@ export function WorkspaceSettings() {
<div className="flex items-center justify-between space-x-4"> <div className="flex items-center justify-between space-x-4">
<div className="flex items-center space-x-4"> <div className="flex items-center space-x-4">
<Avatar> <Avatar>
<AvatarImage src="/avatars/03.png" /> <AvatarImage />
<AvatarFallback> <AvatarFallback>
{email.slice(0, 2).toUpperCase()} {email.slice(0, 2).toUpperCase()}
</AvatarFallback> </AvatarFallback>