Coba Commit
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
export const BASE_URL = '';
|
||||
const getBaseUrl = () => {
|
||||
const segments = window.location.pathname.split('/');
|
||||
const targetIndex = segments.findIndex(seg => ['01', '02', '03', 'versi'].includes(seg));
|
||||
if (targetIndex !== -1) {
|
||||
return segments.slice(0, targetIndex).join('/');
|
||||
}
|
||||
return '';
|
||||
};
|
||||
export const BASE_URL = getBaseUrl();
|
||||
|
||||
const createService = (endpoint) => ({
|
||||
getAll: async () => {
|
||||
|
||||
Reference in New Issue
Block a user