notif cursor

This commit is contained in:
2025-12-21 12:34:45 +03:30
parent c36ff7ed85
commit ecba2773be
5 changed files with 72 additions and 155 deletions
@@ -5,7 +5,7 @@ import { map } from 'rxjs/operators';
@Injectable()
export class ResponseInterceptor implements NestInterceptor {
constructor() {}
constructor() { }
intercept(context: ExecutionContext, next: CallHandler<Record<string, unknown>>): Observable<unknown> {
// For REST endpoints, wrap the response
@@ -35,11 +35,14 @@ export class ResponseInterceptor implements NestInterceptor {
};
}
if (data && data.data !== undefined) {
if (data && 'data' in data) {
return {
statusCode,
success: true,
data: data.data,
data: (data as any).data,
...('nextCursor' in (data as any) && (data as any).nextCursor != null
? { nextCursor: (data as any).nextCursor }
: {}),
};
}
return {