feat: add parameter for base only work
This commit is contained in:
parent
efc37ad80f
commit
dc21fc434d
1 changed files with 2 additions and 1 deletions
|
|
@ -43,12 +43,13 @@ type WorkUpdate = {
|
||||||
export class WorkController extends Controller {
|
export class WorkController extends Controller {
|
||||||
@Get()
|
@Get()
|
||||||
async getWork(
|
async getWork(
|
||||||
|
@Query() baseOnly?: boolean,
|
||||||
@Query() query: string = "",
|
@Query() query: string = "",
|
||||||
@Query() page: number = 1,
|
@Query() page: number = 1,
|
||||||
@Query() pageSize: number = 30,
|
@Query() pageSize: number = 30,
|
||||||
) {
|
) {
|
||||||
const where = {
|
const where = {
|
||||||
OR: [{ name: { contains: query } }],
|
OR: [{ name: { contains: query }, serviceId: baseOnly ? null : undefined }],
|
||||||
} satisfies Prisma.WorkWhereInput;
|
} satisfies Prisma.WorkWhereInput;
|
||||||
|
|
||||||
const [result, total] = await prisma.$transaction([
|
const [result, total] = await prisma.$transaction([
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue