feat: scope customer branch by customer id
This commit is contained in:
parent
359e0ad314
commit
818dd044b6
1 changed files with 3 additions and 1 deletions
|
|
@ -106,6 +106,7 @@ export class CustomerBranchController extends Controller {
|
||||||
@Get()
|
@Get()
|
||||||
async list(
|
async list(
|
||||||
@Query() zipCode?: string,
|
@Query() zipCode?: string,
|
||||||
|
@Query() customerId?: string,
|
||||||
@Query() query: string = "",
|
@Query() query: string = "",
|
||||||
@Query() page: number = 1,
|
@Query() page: number = 1,
|
||||||
@Query() pageSize: number = 30,
|
@Query() pageSize: number = 30,
|
||||||
|
|
@ -116,7 +117,8 @@ export class CustomerBranchController extends Controller {
|
||||||
{ name: { contains: query }, zipCode },
|
{ name: { contains: query }, zipCode },
|
||||||
{ email: { contains: query }, zipCode },
|
{ email: { contains: query }, zipCode },
|
||||||
],
|
],
|
||||||
} satisfies Prisma.BranchWhereInput;
|
AND: { customerId },
|
||||||
|
} satisfies Prisma.CustomerBranchWhereInput;
|
||||||
|
|
||||||
const [result, total] = await prisma.$transaction([
|
const [result, total] = await prisma.$transaction([
|
||||||
prisma.customerBranch.findMany({
|
prisma.customerBranch.findMany({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue