fix: variable name for filter
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s
This commit is contained in:
parent
7e7b8025c9
commit
f50285161b
1 changed files with 20 additions and 20 deletions
|
|
@ -170,10 +170,10 @@ export class CustomerController extends Controller {
|
||||||
@Query() activeBranchOnly?: boolean,
|
@Query() activeBranchOnly?: boolean,
|
||||||
@Query() startDate?: Date,
|
@Query() startDate?: Date,
|
||||||
@Query() endDate?: Date,
|
@Query() endDate?: Date,
|
||||||
@Query() businessType?: string,
|
@Query() businessTypeId?: string,
|
||||||
@Query() province?: string,
|
@Query() provinceId?: string,
|
||||||
@Query() district?: string,
|
@Query() districtId?: string,
|
||||||
@Query() subDistrict?: string,
|
@Query() subDistrictId?: string,
|
||||||
) {
|
) {
|
||||||
const where = {
|
const where = {
|
||||||
OR: queryOrNot<Prisma.CustomerWhereInput[]>(query, [
|
OR: queryOrNot<Prisma.CustomerWhereInput[]>(query, [
|
||||||
|
|
@ -199,27 +199,27 @@ export class CustomerController extends Controller {
|
||||||
branch: {
|
branch: {
|
||||||
some: {
|
some: {
|
||||||
AND: [
|
AND: [
|
||||||
businessType
|
businessTypeId
|
||||||
? {
|
? {
|
||||||
OR: [{ businessType: { id: businessType } }],
|
OR: [{ businessType: { id: businessTypeId } }],
|
||||||
}
|
}
|
||||||
: {},
|
: {},
|
||||||
|
|
||||||
province
|
provinceId
|
||||||
? {
|
? {
|
||||||
OR: [{ province: { id: province } }],
|
OR: [{ province: { id: provinceId } }],
|
||||||
}
|
}
|
||||||
: {},
|
: {},
|
||||||
|
|
||||||
district
|
districtId
|
||||||
? {
|
? {
|
||||||
OR: [{ district: { id: district } }],
|
OR: [{ district: { id: districtId } }],
|
||||||
}
|
}
|
||||||
: {},
|
: {},
|
||||||
|
|
||||||
subDistrict
|
subDistrictId
|
||||||
? {
|
? {
|
||||||
OR: [{ subDistrict: { id: subDistrict } }],
|
OR: [{ subDistrict: { id: subDistrictId } }],
|
||||||
}
|
}
|
||||||
: {},
|
: {},
|
||||||
],
|
],
|
||||||
|
|
@ -630,10 +630,10 @@ export class CustomerExportController extends CustomerController {
|
||||||
@Query() activeBranchOnly?: boolean,
|
@Query() activeBranchOnly?: boolean,
|
||||||
@Query() startDate?: Date,
|
@Query() startDate?: Date,
|
||||||
@Query() endDate?: Date,
|
@Query() endDate?: Date,
|
||||||
@Query() businessType?: string,
|
@Query() businessTypeId?: string,
|
||||||
@Query() province?: string,
|
@Query() provinceId?: string,
|
||||||
@Query() district?: string,
|
@Query() districtId?: string,
|
||||||
@Query() subDistrict?: string,
|
@Query() subDistrictId?: string,
|
||||||
) {
|
) {
|
||||||
const ret = await this.list(
|
const ret = await this.list(
|
||||||
req,
|
req,
|
||||||
|
|
@ -647,10 +647,10 @@ export class CustomerExportController extends CustomerController {
|
||||||
activeBranchOnly,
|
activeBranchOnly,
|
||||||
startDate,
|
startDate,
|
||||||
endDate,
|
endDate,
|
||||||
businessType,
|
businessTypeId,
|
||||||
province,
|
provinceId,
|
||||||
district,
|
districtId,
|
||||||
subDistrict,
|
subDistrictId,
|
||||||
);
|
);
|
||||||
|
|
||||||
this.setHeader("Content-Type", "text/csv");
|
this.setHeader("Content-Type", "text/csv");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue