mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 20:47:10 +11:00
🐎🔨 modified endpoints to better adhere to JSON API conventions
This commit is contained in:
parent
1f0a3dc28d
commit
386a140255
1 changed files with 4 additions and 4 deletions
|
|
@ -10,13 +10,13 @@ drogon::HttpResponsePtr drogon::toResponse(BankResponse &&data)
|
||||||
std::shared_ptr<HttpResponseImpl> res;
|
std::shared_ptr<HttpResponseImpl> res;
|
||||||
if (data.first == k204NoContent)
|
if (data.first == k204NoContent)
|
||||||
{
|
{
|
||||||
res = std::make_shared<HttpResponseImpl>(data.first, CT_APPLICATION_JSON);
|
res = std::make_shared<HttpResponseImpl>();
|
||||||
res->setBody(std::move(data.second));
|
res->setStatusCode(data.first);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res = std::make_shared<HttpResponseImpl>();
|
res = std::make_shared<HttpResponseImpl>(data.first, CT_APPLICATION_JSON);
|
||||||
res->setStatusCode(data.first);
|
res->setBody(std::move(data.second));
|
||||||
}
|
}
|
||||||
const auto &advices = HttpAppFrameworkImpl::instance().getResponseCreationAdvices();
|
const auto &advices = HttpAppFrameworkImpl::instance().getResponseCreationAdvices();
|
||||||
if (!advices.empty())
|
if (!advices.empty())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue