From a03f1dc2ac25579df30e8cb59d2703110c3e564d Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Wed, 13 Mar 2024 22:37:41 +0000 Subject: lint: Lint and format the entire repo with the new configs --- apps/mobile/app/dashboard/add-note.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'apps/mobile/app/dashboard/add-note.tsx') 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}`; } -- cgit v1.2.3-70-g09d2