feat: make field optional

This commit is contained in:
Methapon2001 2024-06-19 16:11:02 +07:00
parent a3207ea026
commit 9ebbb5260f

View file

@ -182,7 +182,7 @@ type EmployeeUpdate = {
coverageExpireDate?: Date | null; coverageExpireDate?: Date | null;
}[]; }[];
employeeOtherInfo: { employeeOtherInfo?: {
citizenId?: string | null; citizenId?: string | null;
fatherFirstName?: string | null; fatherFirstName?: string | null;
fatherLastName?: string | null; fatherLastName?: string | null;
@ -656,11 +656,7 @@ export class EmployeeController extends Controller {
} }
if (record.status !== Status.CREATED) { if (record.status !== Status.CREATED) {
throw new HttpError( throw new HttpError(HttpStatus.FORBIDDEN, "Employee is in used.", "employeeInUsed");
HttpStatus.FORBIDDEN,
"Employee is in used.",
"employeeInUsed",
);
} }
return await prisma.employee.delete({ where: { id: employeeId } }); return await prisma.employee.delete({ where: { id: employeeId } });