From 16cdc1990275f82c56c8a0cc804430fac7b8dcc7 Mon Sep 17 00:00:00 2001 From: Kushagra Sharma <120712705+skushagra9@users.noreply.github.com> Date: Sun, 21 Jan 2024 18:07:02 +0530 Subject: [PATCH] Fixed Empty data from notificaion page (#577) --- apps/web/src/components/forms/notification-form.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/web/src/components/forms/notification-form.tsx b/apps/web/src/components/forms/notification-form.tsx index 5fc63c0f..27795c89 100644 --- a/apps/web/src/components/forms/notification-form.tsx +++ b/apps/web/src/components/forms/notification-form.tsx @@ -130,6 +130,10 @@ export function NotificationForm({ async function onSubmit({ provider, data, ...rest }: InsertNotification) { startTransition(async () => { try { + if (data === "") { + form.setError("data", { message: "This field is required" }); + return; + } if (defaultValues) { await api.notification.update.mutate({ provider, -- 2.51.2