refactor: drop field
This commit is contained in:
parent
42a036c34f
commit
c548386b56
3 changed files with 16 additions and 9 deletions
|
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `zipCode` on the `Employee` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "Employee" DROP COLUMN "zipCode";
|
||||
|
|
@ -516,8 +516,6 @@ model Employee {
|
|||
subDistrict SubDistrict? @relation(fields: [subDistrictId], references: [id], onDelete: SetNull)
|
||||
subDistrictId String?
|
||||
|
||||
zipCode String
|
||||
|
||||
passportType String
|
||||
passportNumber String
|
||||
passportIssueDate DateTime @db.Date
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ type EmployeeCreate = {
|
|||
|
||||
addressEN: string;
|
||||
address: string;
|
||||
zipCode: string;
|
||||
|
||||
passportType: string;
|
||||
passportNumber: string;
|
||||
|
|
@ -139,7 +138,6 @@ type EmployeeUpdate = {
|
|||
|
||||
addressEN?: string;
|
||||
address?: string;
|
||||
zipCode?: string;
|
||||
|
||||
passportType?: string;
|
||||
passportNumber?: string;
|
||||
|
|
@ -275,13 +273,16 @@ export class EmployeeController extends Controller {
|
|||
|
||||
const where = {
|
||||
OR: [
|
||||
{ firstName: { contains: query }, zipCode, gender, ...filterStatus(status) },
|
||||
{ firstNameEN: { contains: query }, zipCode, gender, ...filterStatus(status) },
|
||||
{ lastName: { contains: query }, zipCode, gender, ...filterStatus(status) },
|
||||
{ lastNameEN: { contains: query }, zipCode, gender, ...filterStatus(status) },
|
||||
{ firstName: { contains: query } },
|
||||
{ firstNameEN: { contains: query } },
|
||||
{ lastName: { contains: query } },
|
||||
{ lastNameEN: { contains: query } },
|
||||
],
|
||||
AND: {
|
||||
customerBranch: customerId ? { customerId: customerId } : undefined,
|
||||
...filterStatus(status),
|
||||
customerBranch: customerId ? { customerId } : undefined,
|
||||
subDistrict: zipCode ? { zipCode } : undefined,
|
||||
gender,
|
||||
},
|
||||
} satisfies Prisma.EmployeeWhereInput;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue