HOTFIX: Fix incomplete replacement causing syntax errors in setFirebaseViaREST and readFirebaseSmart

This commit is contained in:
Wizznu 2026-02-11 12:32:48 +07:00
parent 935e1059f6
commit 5e85ad61e2
1 changed files with 6 additions and 6 deletions

View File

@ -371,12 +371,12 @@ async function updateFirebaseSmart(path, updates) {
async function setFirebaseViaREST(path, data) {
const url = `${config.firebase.databaseURL}/${path}.json`;
const response = await fetch(url, {
method: 'PUT',WithTimeout2(url, {
const response = await fetchWithTimeout2(url, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
}, 10000
}, 10000);
if (!response.ok) {
throw new Error(`REST PUT failed: ${response.status}`);
}
@ -425,11 +425,11 @@ async function readFirebaseSmart(path) {
return snapshot.val();
} catch (sdkError) {
const url = `${config.firebase.databaseURL}/${path}.json`;
const response = await fetch(url, {
method: 'GET',WithTimeout2(url, {
const response = await fetchWithTimeout2(url, {
method: 'GET',
headers: { 'Content-Type': 'application/json' }
}, 10000
}, 10000);
if (!response.ok) {
throw new Error(`REST GET failed: ${response.status}`);
}