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
This commit is contained in:
AmirReza Jamali
2025-11-23 11:10:25 +03:30
parent a348124d50
commit b9b05b438a
@@ -38,7 +38,11 @@ const useCreateNotificationFormPresenter = () => {
reset();
});
const onSubmit: SubmitHandler<TCreateNotificationCredentials> = (data) => {
mutate({ credentials: data });
const credentials = {
...data,
schedule_at: data.schedule_at || 0,
};
mutate({ credentials });
};
const handleCancel = () => {
reset();