From f9258878db7c5f725998d390f43412a2ce353254 Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Sat, 25 Nov 2023 10:03:41 +0700 Subject: [PATCH 1/2] Fix Api Common [Server Side] [Console Log] - [+] fix(common.ts): fix console.log statement for [Org ID] to handle undefined value --- app/api/common.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/api/common.ts b/app/api/common.ts index dd1cc0bb..2d662c94 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -30,7 +30,10 @@ export async function requestOpenai(req: NextRequest) { console.log("[Proxy] ", path); console.log("[Base Url]", baseUrl); - console.log("[Org ID]", serverConfig.openaiOrgId); + // this fix [Org ID] undefined in server side if not using custom point + if (serverConfig.openaiOrgId) { + console.log("[Org ID]", serverConfig.openaiOrgId); + } const timeoutId = setTimeout( () => { From f9d916925eec45424bab3592e5eafca69e062a98 Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Sat, 25 Nov 2023 10:23:16 +0700 Subject: [PATCH 2/2] Fixup Api Common [Server Side] [Console Log] - [+] fix(common.ts): fix condition to check if serverConfig.openaiOrgId is not undefined --- app/api/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/common.ts b/app/api/common.ts index 2d662c94..6b0d619d 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -31,7 +31,7 @@ export async function requestOpenai(req: NextRequest) { console.log("[Proxy] ", path); console.log("[Base Url]", baseUrl); // this fix [Org ID] undefined in server side if not using custom point - if (serverConfig.openaiOrgId) { + if (serverConfig.openaiOrgId !== undefined) { console.log("[Org ID]", serverConfig.openaiOrgId); }