Skip to content

Commit 87df10b

Browse files
committed
updated to latest oatpp Async API
1 parent 39dc90d commit 87df10b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main/src/controller/MyController.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class MyController : public oatpp::web::server::api::ApiController {
7272

7373
Action act() override {
7474
/* return Action to start child coroutine to read body */
75-
return request->readBodyToStringAsync(this, &EchoStringBody::returnResponse);
75+
return request->readBodyToStringAsync().callbackTo(&EchoStringBody::returnResponse);
7676
}
7777

7878
Action returnResponse(const oatpp::String& body){
@@ -92,7 +92,7 @@ class MyController : public oatpp::web::server::api::ApiController {
9292
ENDPOINT_ASYNC_INIT(EchoDtoBody)
9393

9494
Action act() override {
95-
return request->readBodyToDtoAsync<MessageDto>(this, &EchoDtoBody::returnResponse, controller->getDefaultObjectMapper());
95+
return request->readBodyToDtoAsync<MessageDto>(controller->getDefaultObjectMapper()).callbackTo(&EchoDtoBody::returnResponse);
9696
}
9797

9898
Action returnResponse(const MessageDto::ObjectWrapper& body){

0 commit comments

Comments
 (0)