aboutsummaryrefslogtreecommitdiff
path: root/pages/admin/index.js
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-10-22 19:43:17 +0700
committerGitHub <[email protected]>2023-10-22 19:43:17 +0700
commitf801f8f422954b884a6541321dba0669ee9d6173 (patch)
treee0d5e106b99e9b4e0a4c4bf7bb0464617db85b8d /pages/admin/index.js
parentBump @babel/traverse from 7.22.8 to 7.23.2 (#90) (diff)
downloadmoopa-4.2.0.tar.xz
moopa-4.2.0.zip
Update v4.2.0 (#93)v4.2.0
Diffstat (limited to 'pages/admin/index.js')
-rw-r--r--pages/admin/index.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/pages/admin/index.js b/pages/admin/index.js
index cbb5086..2a73fc1 100644
--- a/pages/admin/index.js
+++ b/pages/admin/index.js
@@ -27,7 +27,12 @@ export async function getServerSideProps(context) {
}
const admin = sessions?.user?.name === process.env.ADMIN_USERNAME;
- const api = process.env.API_URI;
+
+ let api;
+ api = process.env.API_URI;
+ if (api.endsWith("/")) {
+ api = api.slice(0, -1);
+ }
if (!admin) {
return {