From f8a91f60ba07101fc767041895bb6b29e71e2b6f Mon Sep 17 00:00:00 2001 From: kittapath Date: Mon, 30 Sep 2024 09:45:36 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20call=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/interfaces/call-api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interfaces/call-api.ts b/src/interfaces/call-api.ts index 78f0f14..f3d1b6f 100644 --- a/src/interfaces/call-api.ts +++ b/src/interfaces/call-api.ts @@ -17,7 +17,7 @@ import { addLogSequence } from "./utils"; class CallAPI { //Get public async GetData(request: any, @Path() path: any) { - const token = request.headers.authorization; + const token = "Bearer " + request.headers.authorization.replace("Bearer ", ""); const url = process.env.API_URL + path; try { const response = await axios.get(url, { @@ -54,7 +54,7 @@ class CallAPI { } //Post public async PostData(request: any, @Path() path: any, sendData: any) { - const token = request.headers.authorization; + const token = "Bearer " + request.headers.authorization.replace("Bearer ", ""); const url = process.env.API_URL + path; try { const response = await axios.post(url, sendData, {