chore: fix the next and previous curor
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { UseGuards, applyDecorators } from "@nestjs/common";
|
import { UseGuards, applyDecorators } from "@nestjs/common";
|
||||||
import { ApiBearerAuth, ApiHeader } from "@nestjs/swagger";
|
import { ApiBearerAuth } from "@nestjs/swagger";
|
||||||
|
|
||||||
import { AdminRouteGuard } from "../../modules/auth/guards/admin.guard";
|
import { AdminRouteGuard } from "../../modules/auth/guards/admin.guard";
|
||||||
import { JwtAuthGuard } from "../../modules/auth/guards/auth.guard";
|
import { JwtAuthGuard } from "../../modules/auth/guards/auth.guard";
|
||||||
@@ -8,6 +8,6 @@ export function AuthGuards() {
|
|||||||
return applyDecorators(
|
return applyDecorators(
|
||||||
UseGuards(JwtAuthGuard, AdminRouteGuard),
|
UseGuards(JwtAuthGuard, AdminRouteGuard),
|
||||||
ApiBearerAuth("authorization"),
|
ApiBearerAuth("authorization"),
|
||||||
ApiHeader({ name: "x-business-id", description: "Business ID" }),
|
// ApiHeader({ name: "x-business-id", description: "Business ID" }),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,16 @@ export class MessageListQueryDto extends PaginationDto {
|
|||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsEnum(["asc", "desc"], { message: EmailMessage.ORDER_MUST_BE_VALID })
|
@IsEnum(["asc", "desc"], { message: EmailMessage.ORDER_MUST_BE_VALID })
|
||||||
order?: "asc" | "desc";
|
order?: "asc" | "desc";
|
||||||
|
|
||||||
|
@ApiPropertyOptional({ description: "Next cursor", example: "eyIkb2lkIjoiNWRmMWZkMmQ3NzkyNTExOGI2MDdjNjg0In0" })
|
||||||
|
@IsOptional()
|
||||||
|
@IsString({ message: EmailMessage.NEXT_CURSOR_MUST_BE_STRING })
|
||||||
|
next?: string;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({ description: "Previous cursor", example: "TMIjjIy23ZGM2kk0lIixygWomEknQDWdmzMNIkbNeO0NNjR" })
|
||||||
|
@IsOptional()
|
||||||
|
@IsString({ message: EmailMessage.PREVIOUS_CURSOR_MUST_BE_STRING })
|
||||||
|
previous?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SearchMessagesQueryDto extends PaginationDto {
|
export class SearchMessagesQueryDto extends PaginationDto {
|
||||||
|
|||||||
Reference in New Issue
Block a user