refactor: remove console logs, update SaleInvoicePayload interface, and enhance GoodCategoriesService response mapping
This commit is contained in:
@@ -23,8 +23,6 @@ import { map } from 'rxjs/operators'
|
||||
@Injectable()
|
||||
export class ResponseMappingInterceptor implements NestInterceptor {
|
||||
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
|
||||
console.log('first')
|
||||
|
||||
const http = context.switchToHttp()
|
||||
const response = http.getResponse()
|
||||
const request = http.getRequest()
|
||||
@@ -32,7 +30,6 @@ export class ResponseMappingInterceptor implements NestInterceptor {
|
||||
return next.handle().pipe(
|
||||
map(data => {
|
||||
const statusCode: number = (response as Response)?.statusCode ?? 200
|
||||
console.log(data)
|
||||
|
||||
if (data && typeof data === 'object') {
|
||||
if (Array.isArray((data as any).errors) && statusCode >= 400) {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { GoldKarat } from '../enums/enums'
|
||||
|
||||
export interface SaleInvoicePayload {
|
||||
weight: number
|
||||
karat: keyof typeof GoldKarat
|
||||
wages: number
|
||||
profit: number
|
||||
karat?: keyof typeof GoldKarat
|
||||
wages?: number
|
||||
profit?: number
|
||||
}
|
||||
|
||||
@@ -20,8 +20,6 @@ export const ResponseMapper = {
|
||||
},
|
||||
|
||||
single<T>(item: T): MapperWrapper<T> {
|
||||
console.log('asdasdsaasdsa')
|
||||
|
||||
return { __mapped: 'single', data: item }
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user