From b9b05b438a2d8eeb907ca9dcb6e9719a339add07 Mon Sep 17 00:00:00 2001 From: AmirReza Jamali Date: Sun, 23 Nov 2025 11:10:25 +0330 Subject: [PATCH] fix(notifications): ensure schedule_at field has default value on submit - Add default value of 0 for schedule_at field when not provided - Restructure credentials object to explicitly set schedule_at before mutation - Prevent undefined values from being sent to the API when schedule_at is empty --- .../notifications/useCreateNotificationFormPresenter.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/forms/notifications/useCreateNotificationFormPresenter.ts b/src/components/forms/notifications/useCreateNotificationFormPresenter.ts index d3176be..58ec7e1 100644 --- a/src/components/forms/notifications/useCreateNotificationFormPresenter.ts +++ b/src/components/forms/notifications/useCreateNotificationFormPresenter.ts @@ -38,7 +38,11 @@ const useCreateNotificationFormPresenter = () => { reset(); }); const onSubmit: SubmitHandler = (data) => { - mutate({ credentials: data }); + const credentials = { + ...data, + schedule_at: data.schedule_at || 0, + }; + mutate({ credentials }); }; const handleCancel = () => { reset();