Skip to content

Commit

Permalink
fix resources handler
Browse files Browse the repository at this point in the history
  • Loading branch information
wgtdkp committed Oct 22, 2020
1 parent 735d6ef commit c4951d1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/rest/resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void Resource::GetCurrentNetworkPrefix(const Request &aRequest, Response &aRespo
body = Json::PrefixList2JsonString(configList);

aResponse.SetBody(body);
errorCode = mResponseCodeMap.at(HttpStatusCode::kStatusOk);
errorCode = GetHttpStatus(HttpStatusCode::kStatusOk);
aResponse.SetResponsCode(errorCode);
aResponse.SetComplete();
}
Expand Down Expand Up @@ -293,7 +293,7 @@ void Resource::PostCurrentNetworkPrefix(const Request &aRequest, Response &aResp
if (error == PostError::kPostErrorNone)
{
aResponse.SetBody(requestBody);
errorCode = mResponseCodeMap.at(HttpStatusCode::kStatusOk);
errorCode = GetHttpStatus(HttpStatusCode::kStatusOk);
aResponse.SetResponsCode(errorCode);
aResponse.SetComplete();
}
Expand Down Expand Up @@ -339,7 +339,7 @@ void Resource::DeleteCurrentNetworkPrefix(const Request &aRequest, Response &aRe
if (error == PostError::kPostErrorNone)
{
aResponse.SetBody(requestBody);
errorCode = mResponseCodeMap.at(HttpStatusCode::kStatusOk);
errorCode = GetHttpStatus(HttpStatusCode::kStatusOk);
aResponse.SetResponsCode(errorCode);
aResponse.SetComplete();
}
Expand Down Expand Up @@ -403,7 +403,7 @@ void Resource::CurrentNetworkCommissionCallback(const Request &aRequest, Respons
if (error == PostError::kPostErrorNone)
{
aResponse.SetBody(requestBody);
errorCode = mResponseCodeMap.at(HttpStatusCode::kStatusOk);
errorCode = GetHttpStatus(HttpStatusCode::kStatusOk);
aResponse.SetResponsCode(errorCode);
aResponse.SetComplete();
}
Expand Down Expand Up @@ -489,7 +489,7 @@ void Resource::GetCurrentNetwork(Response &aResponse) const

if (error == OTBR_ERROR_NONE)
{
errorCode = mResponseCodeMap.at(HttpStatusCode::kStatusOk);
errorCode = GetHttpStatus(HttpStatusCode::kStatusOk);
aResponse.SetResponsCode(errorCode);
}
else
Expand Down Expand Up @@ -609,7 +609,7 @@ void Resource::PutCurrentNetworkCallback(const Request &aRequest, Response &aRes
if (error == PostError::kPostErrorNone)
{
aResponse.SetBody(requestBody);
errorCode = mResponseCodeMap.at(HttpStatusCode::kStatusOk);
errorCode = GetHttpStatus(HttpStatusCode::kStatusOk);
aResponse.SetResponsCode(errorCode);
aResponse.SetComplete();
}
Expand Down Expand Up @@ -1093,7 +1093,7 @@ void Resource::PostNetworksCallback(const Request &aRequest, Response &aResponse
if (error == PostError::kPostErrorNone)
{
aResponse.SetBody(requestBody);
errorCode = mResponseCodeMap.at(HttpStatusCode::kStatusOk);
errorCode = GetHttpStatus(HttpStatusCode::kStatusOk);
aResponse.SetResponsCode(errorCode);
aResponse.SetComplete();
}
Expand Down Expand Up @@ -1159,7 +1159,7 @@ void Resource::NetworksResponseHandler(Response * aR
}

body = Json::ScanNetworks2JsonString(results);
errorCode = mResponseCodeMap.at(HttpStatusCode::kStatusOk);
errorCode = GetHttpStatus(HttpStatusCode::kStatusOk);
aResponse->SetResponsCode(errorCode);
aResponse->SetBody(body);
aResponse->SetComplete();
Expand Down

0 comments on commit c4951d1

Please sign in to comment.