$app->put('/user/{uid}/groups', function ($request, $response, $args) { $member = new \Models\Member(); $response->write($member->updateGroupSort($request->getParsedBody(), $args['uid'], \Middleware\Authenticate::$requestUid)); $newResponse = $response->withHeader('Content-type', 'application/json'); return $newResponse; })->add($auth); $app->post('/user', function ($request, $response, $args) { $member = new \Models\Member(); // error_log( print_r($request->getParsedBody(), 1)); $response->write($member->addNewMember($request->getParsedBody())); $newResponse = $response->withHeader('Content-type', 'application/json'); return $newResponse; }); $app->post('/emailexists', function ($request, $response, $args) { $member = new \Models\Member(); $response->write($member->emailExists($request->getParsedBody())); $newResponse = $response->withHeader('Content-type', 'application/json'); return $newResponse; }); $app->delete('/user', function ($request, $response, $args) { $member = new \Models\Member(); $response->write($member->deleteMember($request->getParsedBody(), \Middleware\Authenticate::$requestUid)); $newResponse = $response->withHeader('Content-type', 'application/json'); return $newResponse; })->add($auth); $app->post('/user/forgetpwd', function ($request, $response, $args) { $member = new \Models\Member(); $response->write($member->forgetPwd($request->getParsedBody())); $newResponse = $response->withHeader('Content-type', 'application/json'); return $newResponse; });