completed full updation for expnse feature

This commit is contained in:
pramod mahajan 2025-07-24 12:35:12 +05:30
parent 653051919c
commit 2c3a3ed2bb
2 changed files with 2 additions and 1 deletions

View File

@ -39,10 +39,12 @@ export const ExpenseSchema = (expenseTypes) => {
contentType: z.string().refine((val) => ALLOWED_TYPES.includes(val), { contentType: z.string().refine((val) => ALLOWED_TYPES.includes(val), {
message: "Only PDF, PNG, JPG, or JPEG files are allowed", message: "Only PDF, PNG, JPG, or JPEG files are allowed",
}), }),
documentId:z.string().optional(),
fileSize: z.number().max(MAX_FILE_SIZE, { fileSize: z.number().max(MAX_FILE_SIZE, {
message: "File size must be less than or equal to 5MB", message: "File size must be less than or equal to 5MB",
}), }),
description: z.string().optional(), description: z.string().optional(),
isActive:z.boolean().default(true)
}) })
) )
.nonempty({ message: "At least one file attachment is required" }), .nonempty({ message: "At least one file attachment is required" }),

View File

@ -71,7 +71,6 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
error: EmpError, error: EmpError,
} = useEmployeesByProject(selectedproject); } = useEmployeesByProject(selectedproject);
const files = watch("billAttachments"); const files = watch("billAttachments");
const onFileChange = async (e) => { const onFileChange = async (e) => {
const newFiles = Array.from(e.target.files); const newFiles = Array.from(e.target.files);