Heey, i dont seem to be able to return status codes from my dart functions, am I missing something?
return res.json(
{"message": "E-Mail is missing."},
400,
);
TL;DR
The user was having an issue with returning status codes from a function in Dart. Another user suggested that they might need to remove the 'return' keyword before 'res.json'. This turned out to be the solution.
safwan
28 Mar, 2023, 18:53
I haven't used dart for server-side code, but are you sure you need to return res.json, and not just res.json?
Ipsoka
28 Mar, 2023, 18:55
Shouldnt make a difference in dart world
rafagazani
28 Mar, 2023, 19:46
return res.json(
{"message": "E-Mail is missing."},
status: 400,
)