Update api.js
This commit is contained in:
@@ -17,11 +17,12 @@ const showToast = (message, duration = 3000) => {
|
|||||||
const fetchWithAuth = async (url, options = {}) => {
|
const fetchWithAuth = async (url, options = {}) => {
|
||||||
const headers = {
|
const headers = {
|
||||||
...(options.headers || {}),
|
...(options.headers || {}),
|
||||||
...(state.apiKey ? { 'Authorization': `Bearer ${state.apiKey}` } : {})
|
...(state.apiKey ? { 'X-API-Key': state.apiKey } : {}) // Use X-API-Key instead of Bearer
|
||||||
};
|
};
|
||||||
return fetch(url, { ...options, headers });
|
return fetch(url, { ...options, headers });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Page renderers
|
// Page renderers
|
||||||
const pages = {
|
const pages = {
|
||||||
'file-manager': () => `
|
'file-manager': () => `
|
||||||
|
Reference in New Issue
Block a user