From 451e4dffd000169e7113aa3275e4acaf7f1fbbbc Mon Sep 17 00:00:00 2001 From: Factiven Date: Tue, 24 Oct 2023 20:27:32 +0700 Subject: Update v4.2.2 --- pages/admin/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pages/admin') diff --git a/pages/admin/index.js b/pages/admin/index.js index 2a73fc1..6cb9a76 100644 --- a/pages/admin/index.js +++ b/pages/admin/index.js @@ -29,8 +29,8 @@ export async function getServerSideProps(context) { const admin = sessions?.user?.name === process.env.ADMIN_USERNAME; let api; - api = process.env.API_URI; - if (api.endsWith("/")) { + api = process.env.API_URI || null; + if (api && api.endsWith("/")) { api = api.slice(0, -1); } -- cgit v1.2.3