forked from Yara724/api
Fix SMS, and added pagination+sorting+searching for GETs
This commit is contained in:
@@ -41,6 +41,7 @@ import {
|
||||
VideoCaptureV2ResponseDto,
|
||||
} from "./dto/capture-part-v2.dto";
|
||||
import { GetMyClaimsV2ResponseDto } from "./dto/my-claims-v2.dto";
|
||||
import { ListQueryV2Dto } from "src/common/dto/list-query-v2.dto";
|
||||
import { ClaimDetailsV2ResponseDto } from "./dto/claim-details-v2.dto";
|
||||
import { UserObjectionV2Dto } from "./dto/user-objection-v2.dto";
|
||||
import { UserRatingDto } from "./dto/user-rating.dto";
|
||||
@@ -60,16 +61,24 @@ export class ClaimRequestManagementV2Controller {
|
||||
@Get("requests")
|
||||
@ApiOperation({
|
||||
summary: "Get My Claims (V2)",
|
||||
description: "Get list of all claim requests for the current user.",
|
||||
description:
|
||||
"Claims for the current user (or field-expert in-person files). Optional query: `search`, `sortBy` (publicId | createdAt | requestNo | status), `sortOrder`, `page`, `limit`. Without `page`/`limit`, returns the full filtered list.",
|
||||
})
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
description: "List of user claims",
|
||||
type: GetMyClaimsV2ResponseDto,
|
||||
})
|
||||
async getMyClaims(@CurrentUser() user: any): Promise<GetMyClaimsV2ResponseDto> {
|
||||
async getMyClaims(
|
||||
@CurrentUser() user: any,
|
||||
@Query() query: ListQueryV2Dto,
|
||||
): Promise<GetMyClaimsV2ResponseDto> {
|
||||
try {
|
||||
return await this.claimRequestManagementService.getMyClaimsV2(user.sub, user);
|
||||
return await this.claimRequestManagementService.getMyClaimsV2(
|
||||
user.sub,
|
||||
user,
|
||||
query,
|
||||
);
|
||||
} catch (error) {
|
||||
if (error instanceof HttpException) throw error;
|
||||
throw new InternalServerErrorException(
|
||||
|
||||
Reference in New Issue
Block a user