Update api.js

This commit is contained in:
Saifeddine ALOUI
2025-01-31 16:08:23 +01:00
committed by GitHub
parent d1210851aa
commit d2a550fd31

View File

@@ -15,7 +15,7 @@ const showToast = (message, duration = 3000) => {
}; };
const fetchWithAuth = async (url, options = {}) => { const fetchWithAuth = async (url, options = {}) => {
console.log(`Calling server with api key : ${}`) console.log(`Calling server with api key : ${state.apiKey}`)
const headers = { const headers = {
...(options.headers || {}), ...(options.headers || {}),
...(state.apiKey ? { 'X-API-Key': state.apiKey } : {}) // Use X-API-Key instead of Bearer ...(state.apiKey ? { 'X-API-Key': state.apiKey } : {}) // Use X-API-Key instead of Bearer