@cleardu/core 1.0.519 → 1.0.521
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,3 +15,13 @@ exports.SuccessInterceptor = SuccessInterceptor;
|
|
|
15
15
|
exports.SuccessInterceptor = SuccessInterceptor = tslib_1.__decorate([
|
|
16
16
|
(0, common_1.Injectable)()
|
|
17
17
|
], SuccessInterceptor);
|
|
18
|
+
// @Injectable()
|
|
19
|
+
// export class SuccessInterceptor implements NestInterceptor {
|
|
20
|
+
// private readonly logger = new Logger(SuccessInterceptor.name);
|
|
21
|
+
// intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
|
|
22
|
+
// return next.handle().pipe(
|
|
23
|
+
// tap(response => {
|
|
24
|
+
// }),
|
|
25
|
+
// );
|
|
26
|
+
// }
|
|
27
|
+
// }
|
|
@@ -3,10 +3,11 @@ import {
|
|
|
3
3
|
ExecutionContext,
|
|
4
4
|
HttpStatus,
|
|
5
5
|
Injectable,
|
|
6
|
+
Logger,
|
|
6
7
|
NestInterceptor,
|
|
7
8
|
} from '@nestjs/common';
|
|
8
9
|
import { Observable } from 'rxjs';
|
|
9
|
-
import { map } from 'rxjs/operators';
|
|
10
|
+
import { map, tap } from 'rxjs/operators';
|
|
10
11
|
|
|
11
12
|
export interface Response<T> {
|
|
12
13
|
data: T;
|
|
@@ -20,3 +21,14 @@ export class SuccessInterceptor<T> implements NestInterceptor<T, Response<T>> {
|
|
|
20
21
|
.pipe(map((data) => ({ ...data, statusCode: HttpStatus.OK })));
|
|
21
22
|
}
|
|
22
23
|
}
|
|
24
|
+
|
|
25
|
+
// @Injectable()
|
|
26
|
+
// export class SuccessInterceptor implements NestInterceptor {
|
|
27
|
+
// private readonly logger = new Logger(SuccessInterceptor.name);
|
|
28
|
+
// intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
|
|
29
|
+
// return next.handle().pipe(
|
|
30
|
+
// tap(response => {
|
|
31
|
+
// }),
|
|
32
|
+
// );
|
|
33
|
+
// }
|
|
34
|
+
// }
|