fix: changes to error on schedule name empty save (#24044)
* fix #21709: change to error on schedule name empty save * fix comments * minor enahncemnts --------- Co-authored-by: Volnei Munhoz <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
4 files changed
+7
-2
No files matched your search
@@ -120,6 +120,10 @@ export const AvailabilitySettingsWebWrapper = ({
|
|||||||
scheduleId && deleteMutation.mutate({ scheduleId });
|
scheduleId && deleteMutation.mutate({ scheduleId });
|
||||||
}}
|
}}
|
||||||
handleSubmit={async ({ dateOverrides, ...values }) => {
|
handleSubmit={async ({ dateOverrides, ...values }) => {
|
||||||
|
if (!values.name.trim()) {
|
||||||
|
showToast(t("schedule_name_cannot_be_empty"), "error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
scheduleId &&
|
scheduleId &&
|
||||||
updateMutation.mutate({
|
updateMutation.mutate({
|
||||||
scheduleId,
|
scheduleId,
|
||||||
|
|||||||
@@ -4010,6 +4010,7 @@
|
|||||||
"choose_a_voice_for_your_agent": "Choose a voice for your agent",
|
"choose_a_voice_for_your_agent": "Choose a voice for your agent",
|
||||||
"trait": "Trait",
|
"trait": "Trait",
|
||||||
"voice_id": "Voice ID",
|
"voice_id": "Voice ID",
|
||||||
|
"schedule_name_cannot_be_empty": "Schedule name cannot be empty",
|
||||||
"use_voice": "Use voice",
|
"use_voice": "Use voice",
|
||||||
"current_voice": "Current voice",
|
"current_voice": "Current voice",
|
||||||
"setup_incoming_agent": "Set up incoming agent",
|
"setup_incoming_agent": "Set up incoming agent",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export type TCreateInputSchema = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const ZCreateInputSchema: z.ZodType<TCreateInputSchema> = z.object({
|
export const ZCreateInputSchema: z.ZodType<TCreateInputSchema> = z.object({
|
||||||
name: z.string(),
|
name: z.string().trim().min(1, "Schedule name cannot be empty"),
|
||||||
schedule: z
|
schedule: z
|
||||||
.array(
|
.array(
|
||||||
z.array(
|
z.array(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { timeZoneSchema } from "@calcom/lib/dayjs/timeZone.schema";
|
|||||||
export const ZUpdateInputSchema = z.object({
|
export const ZUpdateInputSchema = z.object({
|
||||||
scheduleId: z.number(),
|
scheduleId: z.number(),
|
||||||
timeZone: timeZoneSchema.optional(),
|
timeZone: timeZoneSchema.optional(),
|
||||||
name: z.string().optional(),
|
name: z.string().trim().min(1, "Schedule name cannot be empty").optional(),
|
||||||
isDefault: z.boolean().optional(),
|
isDefault: z.boolean().optional(),
|
||||||
schedule: z
|
schedule: z
|
||||||
.array(
|
.array(
|
||||||
|
|||||||
Reference in new issue
Block a user