From 109bea3fc841845278e555108ed9a0b0717fd90c Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 18 Apr 2024 15:57:03 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89api=E0=B8=A2?= =?UTF-8?q?=E0=B8=B4=E0=B8=87=E0=B9=84=E0=B8=9B=E0=B8=82=E0=B9=89=E0=B8=B2?= =?UTF-8?q?=E0=B8=87=E0=B8=99=E0=B8=AD=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/DevelopmentController.ts | 12 ++++++------ src/interfaces/call-api.ts | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/controllers/DevelopmentController.ts b/src/controllers/DevelopmentController.ts index 16d62bd..660ec50 100644 --- a/src/controllers/DevelopmentController.ts +++ b/src/controllers/DevelopmentController.ts @@ -141,7 +141,7 @@ export class DevelopmentController extends Controller { development.createdFullName = request.user.name; development.lastUpdateUserId = request.user.sub; development.lastUpdateFullName = request.user.name; - + await this.developmentRepository.save(development); return new HttpSuccess(development.id); } @@ -247,13 +247,13 @@ export class DevelopmentController extends Controller { break; } case 3: { - development.child4 = _null; - development.child4Id = _null; - development.child4ShortName = _null; + development.child4 = _null; + development.child4Id = _null; + development.child4ShortName = _null; break; } - default: - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงการ/หลักสูตรการฝึกอบรม"); + default: + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโครงการ/หลักสูตรการฝึกอบรม"); } await this.developmentRepository.save(development); return new HttpSuccess(development.id); diff --git a/src/interfaces/call-api.ts b/src/interfaces/call-api.ts index 8608230..4cbd1a5 100644 --- a/src/interfaces/call-api.ts +++ b/src/interfaces/call-api.ts @@ -21,7 +21,7 @@ class CallAPI { try { const response = await axios.get(url, { headers: { - Authorization: `Bearer ${token}`, + Authorization: `${token}`, "Content-Type": "application/json", }, }); @@ -37,7 +37,7 @@ class CallAPI { try { const response = await axios.post(url, sendData, { headers: { - Authorization: `Bearer ${token}`, + Authorization: `${token}`, "Content-Type": "application/json", }, });