mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
FE - graphql response wrap into data
This commit is contained in:
@@ -199,8 +199,8 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
|
||||
console.log("Response:", response);
|
||||
|
||||
// Handle the successful response
|
||||
if (response && response.settings) {
|
||||
const settingsData = response.settings.settings;
|
||||
if (response && response.data && response.data.settings && response.data.settings.settings) {
|
||||
const settingsData = response.data.settings.settings;
|
||||
console.log("Settings:", settingsData);
|
||||
|
||||
// Wrong number of settings processing
|
||||
|
||||
@@ -249,7 +249,7 @@ function fetchUsedIps(callback) {
|
||||
|
||||
console.log(response);
|
||||
|
||||
const usedIps = (response?.devices?.devices || [])
|
||||
const usedIps = (response?.data?.devices?.devices || [])
|
||||
.map(d => d.devLastIP)
|
||||
.filter(ip => ip && ip.includes('.'));
|
||||
callback(usedIps);
|
||||
|
||||
Reference in New Issue
Block a user