feat(FE) : json role
This commit is contained in:
No files matched your search
+6
-1
@@ -14,7 +14,12 @@ export const getAntrianOperasiById = async (id: string | number) => {
|
||||
}
|
||||
|
||||
export const updateStatusAntrianOperasi = async (id: string | number, data: any) => {
|
||||
const response = await api.put(`/antrian-operasi/${id}/status`, data)
|
||||
const response = await api.put(`/antrian-operasi/${id}/update-status`, data)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export const deleteAntrianOperasi = async (id: string | number) => {
|
||||
const response = await api.delete(`/antrian-operasi/${id}`)
|
||||
return response.data
|
||||
}
|
||||
|
||||
|
||||
+7
-4
@@ -17,10 +17,13 @@ const apiGomed = axios.create({
|
||||
|
||||
// Shared request interceptor
|
||||
const requestInterceptor = (config: any) => {
|
||||
const token = localStorage.getItem('token')
|
||||
|
||||
if (token) {
|
||||
config.headers.Authorization = `Bearer ${token}`
|
||||
// Only access localStorage on client-side (avoid SSR errors)
|
||||
if (process.client) {
|
||||
const idToken = localStorage.getItem('idToken')
|
||||
|
||||
if (idToken) {
|
||||
config.headers.Authorization = `Bearer ${idToken}`
|
||||
}
|
||||
}
|
||||
|
||||
return config
|
||||
|
||||
Reference in New Issue
Block a user