forked from Yara724/api
Fix SMS, and added pagination+sorting+searching for GETs
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { RequestManagementModel } from "src/request-management/entities/schema/request-management.schema";
|
||||
|
||||
export class AllRequestDto {
|
||||
@@ -122,7 +123,30 @@ export class AllRequestDtoV2 {
|
||||
|
||||
export class AllRequestDtoRsV2 {
|
||||
data: AllRequestDtoV2[];
|
||||
constructor(items: AllRequestDtoV2[]) {
|
||||
this.data = items;
|
||||
|
||||
@ApiProperty({ description: "Total rows after search filter" })
|
||||
total: number;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
page?: number;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
limit?: number;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
totalPages?: number;
|
||||
|
||||
constructor(payload: {
|
||||
data: AllRequestDtoV2[];
|
||||
total: number;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
totalPages?: number;
|
||||
}) {
|
||||
this.data = payload.data;
|
||||
this.total = payload.total;
|
||||
this.page = payload.page;
|
||||
this.limit = payload.limit;
|
||||
this.totalPages = payload.totalPages;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user