aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/app/dashboard/add-note.tsx
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-03-13 22:37:41 +0000
committerMohamed Bassem <me@mbassem.com>2024-03-14 16:40:45 +0000
commita03f1dc2ac25579df30e8cb59d2703110c3e564d (patch)
tree59315e73cd83dc391660071c70752cf23989b3da /apps/mobile/app/dashboard/add-note.tsx
parent04572a8e5081b1e4871e273cde9dbaaa44c52fe0 (diff)
downloadkarakeep-a03f1dc2ac25579df30e8cb59d2703110c3e564d.tar.zst
lint: Lint and format the entire repo with the new configs
Diffstat (limited to 'apps/mobile/app/dashboard/add-note.tsx')
-rw-r--r--apps/mobile/app/dashboard/add-note.tsx11
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/mobile/app/dashboard/add-note.tsx b/apps/mobile/app/dashboard/add-note.tsx
index cf775a15..1f903e94 100644
--- a/apps/mobile/app/dashboard/add-note.tsx
+++ b/apps/mobile/app/dashboard/add-note.tsx
@@ -1,7 +1,6 @@
-import { useRouter } from "expo-router";
import { useState } from "react";
-import { View, Text } from "react-native";
-
+import { Text, View } from "react-native";
+import { useRouter } from "expo-router";
import { Button } from "@/components/ui/Button";
import { Input } from "@/components/ui/Input";
import { api } from "@/lib/trpc";
@@ -24,9 +23,9 @@ export default function AddNote() {
},
onError: (e) => {
let message;
- if (e.data?.code === "BAD_REQUEST") {
- const error = JSON.parse(e.message)[0];
- message = error.message;
+ if (e.data?.zodError) {
+ const zodError = e.data.zodError;
+ message = JSON.stringify(zodError);
} else {
message = `Something went wrong: ${e.message}`;
}