refactor: remove console logs, update SaleInvoicePayload interface, and enhance GoodCategoriesService response mapping

This commit is contained in:
2026-02-17 20:16:36 +03:30
parent 55b96d4f79
commit c7cd7cd855
7 changed files with 32 additions and 23 deletions
@@ -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
}
-2
View File
@@ -20,8 +20,6 @@ export const ResponseMapper = {
},
single<T>(item: T): MapperWrapper<T> {
console.log('asdasdsaasdsa')
return { __mapped: 'single', data: item }
},