From 97a2c8a9f6656166975a96301c630f48215c7fba Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Wed, 13 Mar 2024 22:38:34 +0100 Subject: [PATCH] Fix the "error" bug Even when the requests was sucessfull, the "error" toast was appearing... now it should do a "success" when adequate --- frontend/src/rest/restConsumer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/rest/restConsumer.js b/frontend/src/rest/restConsumer.js index b2d1546..ce365c2 100644 --- a/frontend/src/rest/restConsumer.js +++ b/frontend/src/rest/restConsumer.js @@ -41,7 +41,8 @@ async function _rest(endPoint, config){ pending: config['pending'] != null ? config['pending'] : 'pending', error: config['error'] != null ? config['error'] : 'Network Failure...', success: config['success'] != null ? config['success'] : {render(res){ - return res.ok ? "Success" : "error"; + console.log(res); + return res.data.ok ? "Success" : "error"; }}, }) .then( e => e.json()).catch( e => e );