Skip to content

Commit

Permalink
feat: add production url
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Apr 8, 2024
1 parent 9497c8b commit c332254
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<script src="./js/dashboard.mjs" type="module"></script>
</head>

<body data-url="http://localhost:8000/">
<body data-url="https://api.ulems.my.id/">

<!-- Nav bottom -->
<nav class="navbar bg-light navbar-expand fixed-bottom rounded-top-4 border-top d-md-none d-lg-none d-xl-none m-0 p-0">
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<script src="./js/app.mjs" type="module" defer></script>
</head>

<body data-key="33053b5b203160faac438b886ba7129d5330ab2ea9d0da10c8" data-url="http://localhost:8000/" style="overflow-y: hidden;">
<body data-key="bfb9cfea33ab7ae21a315fbd6f065a815d3e20ff2f007aa2ca" data-url="https://api.ulems.my.id/" style="overflow-y: hidden;">

<!-- Navbar Bottom -->
<nav class="navbar navbar-dark bg-dark navbar-expand fixed-bottom rounded-top-4 p-0" id="navbar-menu">
Expand Down
10 changes: 7 additions & 3 deletions js/util.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,14 @@ export const util = (() => {

const storeConfig = async (token) => {
const config = storage('config');
await request(HTTP_GET, '/api/config')
return await request(HTTP_GET, '/api/config')
.token(token)
.then((res) => {
for (let [key, value] of Object.entries(res.data)) {
config.set(key, value);
}

return res.code;
});
};

Expand All @@ -197,8 +199,10 @@ export const util = (() => {

const token = document.querySelector('body').getAttribute('data-key');
storage('session').set('token', token);
await storeConfig(token);
await comment.comment();
const status = await storeConfig(token);
if (status === 200) {
await comment.comment();
}
};

return {
Expand Down

0 comments on commit c332254

Please sign in to comment.