Send 204 when WebAPI response contains no data

This commit is contained in:
Thomas Piccirello 2024-11-21 16:16:29 -03:00
commit 72548fd18d
No known key found for this signature in database

View file

@ -361,6 +361,12 @@ void WebApplication::doProcessRequest()
try
{
const APIResult result = controller->run(action, m_params, data);
if (result.data.isNull())
{
status(204);
}
else
{
switch (result.data.userType())
{
case QMetaType::QJsonDocument:
@ -393,6 +399,7 @@ void WebApplication::doProcessRequest()
break;
}
}
}
catch (const APIError &error)
{
// re-throw as HTTPError