From 3f0963d3e83dd85f082b2fcf041b5932fd0a54c8 Mon Sep 17 00:00:00 2001 From: Yashwin Date: Fri, 3 Apr 2026 15:25:46 +0530 Subject: [PATCH] refactor: make webhook URL optional in validation and comment out unused status selection fields --- src/components/shared/DepartmentModals.tsx | 4 ++-- src/components/shared/DesignationModals.tsx | 4 ++-- src/components/superadmin/NewModuleModal.tsx | 8 +++++++- src/pages/tenant/Users.tsx | 10 +++++----- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/components/shared/DepartmentModals.tsx b/src/components/shared/DepartmentModals.tsx index 2df7887..aa66370 100644 --- a/src/components/shared/DepartmentModals.tsx +++ b/src/components/shared/DepartmentModals.tsx @@ -166,14 +166,14 @@ export const NewDepartmentModal = ({ /> - setValue("is_active", value === "true")} error={errors.is_active?.message} - /> + /> */} ); diff --git a/src/components/shared/DesignationModals.tsx b/src/components/shared/DesignationModals.tsx index 3a1459e..b1aecb8 100644 --- a/src/components/shared/DesignationModals.tsx +++ b/src/components/shared/DesignationModals.tsx @@ -141,14 +141,14 @@ export const NewDesignationModal = ({ /> - setValue("is_active", value === "true")} error={errors.is_active?.message} - /> + /> */} ); diff --git a/src/components/superadmin/NewModuleModal.tsx b/src/components/superadmin/NewModuleModal.tsx index d7d4739..779829a 100644 --- a/src/components/superadmin/NewModuleModal.tsx +++ b/src/components/superadmin/NewModuleModal.tsx @@ -30,7 +30,13 @@ const newModuleSchema = z.object({ .min(1, 'runtime_language is required') .max(50, 'runtime_language must be at most 50 characters'), framework: z.string().max(50, 'framework must be at most 50 characters').optional().nullable(), - webhookurl: z.string().max(500, "webhookurl must be at most 500 characters").url("Invalid URL format").nullable(), + webhookurl: z + .union([ + z.string().url("Invalid URL format").max(500, "webhookurl must be at most 500 characters"), + z.literal("").transform(() => null), + z.null(), + ]) + .optional(), frontend_base_url: z .string() .min(1, 'frontend_base_url is required') diff --git a/src/pages/tenant/Users.tsx b/src/pages/tenant/Users.tsx index e42361f..144ca31 100644 --- a/src/pages/tenant/Users.tsx +++ b/src/pages/tenant/Users.tsx @@ -437,11 +437,11 @@ const Users = (): ReactElement => { label="Status" options={[ { value: "active", label: "Active" }, - { - value: "pending_verification", - label: "Pending Verification", - }, - { value: "inactive", label: "Inactive" }, + // { + // value: "pending_verification", + // label: "Pending Verification", + // }, + // { value: "inactive", label: "Inactive" }, { value: "suspended", label: "Suspended" }, { value: "deleted", label: "Deleted" }, ]}