This commit is contained in:
Bruno Rybársky 2024-02-06 16:37:23 +01:00
parent 6f4e8a4b43
commit 4c748a1007

@ -91,11 +91,10 @@ async function doPageAction(requestData, wantsReturn = false) {
throw new Error(`HTTP error! Status: ${response.status}`); throw new Error(`HTTP error! Status: ${response.status}`);
} }
if (wantsReturn) {
return await response.json();
} else {
const data = await response.json(); const data = await response.json();
handlePageResponse(data); handlePageResponse(data);
if (wantsReturn) {
return data;
} }
} catch (error) { } catch (error) {
console.error('Error:', error); console.error('Error:', error);