fix(paginate) perbaikan function pagination endpoint
continuous-integration/drone/tag Build is passing Details

pull/3/head devel_10.4.2
Aswin Ashar Abdullah 2024-06-20 16:26:02 +07:00
parent 23f5ed0946
commit 9445d561ac
1 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@ import { createPaginationResponse } from './utils/pagination-meta.helper';
@Injectable() @Injectable()
export class TransformInterceptor implements NestInterceptor { export class TransformInterceptor implements NestInterceptor {
constructor(protected readonly reflector: Reflector) {} constructor(protected readonly reflector: Reflector) { }
intercept(context: ExecutionContext, next: CallHandler): Observable<any> { intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
const isPagination = this.reflector.getAllAndOverride<boolean>( const isPagination = this.reflector.getAllAndOverride<boolean>(
PAGINATION_RESPONSE, PAGINATION_RESPONSE,
@ -21,8 +21,8 @@ export class TransformInterceptor implements NestInterceptor {
); );
const request = context.switchToHttp().getRequest<Request>(); const request = context.switchToHttp().getRequest<Request>();
const start = request.params.page ?? 1; const start = request.query.page ?? 1;
const limit = request.params.limit ?? 10; const limit = request.query.limit ?? 10;
return next.handle().pipe( return next.handle().pipe(
map((data) => { map((data) => {