@@ -37,8 +37,8 @@ class PostUserHandler extends AbstractRequestHandler {
37
37
this .cors (' *' );
38
38
}
39
39
40
- execute (body , context ) {
41
- return { message: ' Hello from aws-wave' };
40
+ execute (body , context , callback ) {
41
+ callback ( { message: ' Hello from aws-wave' }) ;
42
42
}
43
43
}
44
44
@@ -86,8 +86,8 @@ class PhoneConfirmationHandler extends AbstractRequestHandler {
86
86
this .cors (' *' );
87
87
}
88
88
89
- execute (body , context ) {
90
- return { message: ' The request body is valid!' };
89
+ execute (body , context , callback ) {
90
+ callback ( { message: ' The request body is valid!' }) ;
91
91
}
92
92
}
93
93
@@ -160,8 +160,8 @@ class MyHandler extends AbstractRequestHandler {
160
160
this .cors (' *' );
161
161
}
162
162
163
- execute (body , context ) {
164
- return { message: ' The request body is valid!' };
163
+ execute (body , context , callback ) {
164
+ callback ( { message: ' The request body is valid!' }) ;
165
165
}
166
166
167
167
resolveRequestBodyValidator () {
@@ -240,12 +240,12 @@ class PostUserHandler extends AbstractRequestHandler {
240
240
this .cors (' *' );
241
241
}
242
242
243
- execute (body , context ) {
243
+ execute (body , context , callback ) {
244
244
// any validation
245
245
if (body .hasPermission )
246
- throw new UnauthorizedException ({' The user has no permission' });
246
+ return callback ( new UnauthorizedException ({' The user has no permission' }) );
247
247
248
- return { message: ' The user has permission' };
248
+ callback ( { message: ' The user has permission' }) ;
249
249
}
250
250
}
251
251
0 commit comments