chore: fix the next and previous curor

This commit is contained in:
mahyargdz
2025-07-27 08:50:08 +03:30
parent 00847a9449
commit 6f24e860c6
2 changed files with 12 additions and 2 deletions
@@ -1,5 +1,5 @@
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 { JwtAuthGuard } from "../../modules/auth/guards/auth.guard";
@@ -8,6 +8,6 @@ export function AuthGuards() {
return applyDecorators(
UseGuards(JwtAuthGuard, AdminRouteGuard),
ApiBearerAuth("authorization"),
ApiHeader({ name: "x-business-id", description: "Business ID" }),
// ApiHeader({ name: "x-business-id", description: "Business ID" }),
);
}
+10
View File
@@ -10,6 +10,16 @@ export class MessageListQueryDto extends PaginationDto {
@IsOptional()
@IsEnum(["asc", "desc"], { message: EmailMessage.ORDER_MUST_BE_VALID })
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 {