completed full updation for expnse feature
This commit is contained in:
parent
653051919c
commit
2c3a3ed2bb
@ -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" }),
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user