1
0
forked from PGL/Clyde

Fix the "error" bug

Even when the requests was sucessfull, the "error" toast was
appearing... now it should do a "success" when adequate
This commit is contained in:
Debucquoy Anthony 2024-03-13 22:38:34 +01:00 committed by Debucquoy Anthony
parent 6228e21d38
commit 97a2c8a9f6

View File

@ -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 );