aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/sidebar
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-03-19 12:41:06 +0000
committerMohamedBassem <me@mbassem.com>2024-03-19 12:44:12 +0000
commit64fb87d0ceb591a49aacad39bf5e885cab7decfa (patch)
treeda60a56a0f6546d20d753519e525e9259f789e9c /apps/web/components/dashboard/sidebar
parentf94432b94512cef90cca6d0d5396b4547ccbe68b (diff)
downloadkarakeep-64fb87d0ceb591a49aacad39bf5e885cab7decfa.tar.zst
feature(web): Add support for demo mode
Diffstat (limited to 'apps/web/components/dashboard/sidebar')
-rw-r--r--apps/web/components/dashboard/sidebar/NewListModal.tsx17
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/web/components/dashboard/sidebar/NewListModal.tsx b/apps/web/components/dashboard/sidebar/NewListModal.tsx
index e244411d..31c35d6c 100644
--- a/apps/web/components/dashboard/sidebar/NewListModal.tsx
+++ b/apps/web/components/dashboard/sidebar/NewListModal.tsx
@@ -67,10 +67,19 @@ export default function NewListModal() {
},
onError: (e) => {
if (e.data?.code == "BAD_REQUEST") {
- toast({
- variant: "destructive",
- description: e.message,
- });
+ if (e.data.zodError) {
+ toast({
+ variant: "destructive",
+ description: Object.values(e.data.zodError.fieldErrors)
+ .flat()
+ .join("\n"),
+ });
+ } else {
+ toast({
+ variant: "destructive",
+ description: e.message,
+ });
+ }
} else {
toast({
variant: "destructive",