-แก้ไขระบบ trow api และ ยิง
This commit is contained in:
@@ -54,8 +54,14 @@ export class GeneralService {
|
||||
return this.http.post(fullUrl, payload, this.getHttpOptions()).pipe(
|
||||
map((res: any) => res),
|
||||
catchError((error: any) => {
|
||||
const response = error?.error;
|
||||
console.error('❌ [POST Request Error]:', error);
|
||||
return throwError(() => error);
|
||||
return throwError(() => ({
|
||||
status: error.status,
|
||||
code: response?.code ?? '500',
|
||||
message: response?.message ?? 'Internal Server Error',
|
||||
message_th: response?.message_th ?? 'เกิดข้อผิดพลาดภายในเซิร์ฟเวอร์'
|
||||
}));
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -66,9 +72,14 @@ export class GeneralService {
|
||||
return this.http.get(fullUrl, this.getHttpOptions()).pipe(
|
||||
map((res: any) => res),
|
||||
catchError((error: any) => {
|
||||
const response = error?.error;
|
||||
console.error('❌ [GET Request Error]:', error);
|
||||
return throwError(() => error);
|
||||
})
|
||||
return throwError(() => ({
|
||||
status: error.status,
|
||||
code: response?.code ?? '500',
|
||||
message: response?.message ?? 'Internal Server Error',
|
||||
message_th: response?.message_th ?? 'เกิดข้อผิดพลาดภายในเซิร์ฟเวอร์'
|
||||
})); })
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user