updated returnAsResource parameters

This commit is contained in:
2023-03-29 15:46:06 +10:00
parent 06c9d48126
commit c96b3d8349
7 changed files with 23 additions and 31 deletions

View File

@@ -56,8 +56,8 @@ class UserController extends ApiController
return $this->respondAsResource(
$collection,
true,
['total' => $total]
['isCollection' => true,
'appendData' => ['total' => $total]]
);
}
@@ -71,7 +71,7 @@ class UserController extends ApiController
{
if (UserConductor::creatable() === true) {
$user = User::create($request->all());
return $this->respondAsResource(UserConductor::model($request, $user), false, [], null, HttpResponseCodes::HTTP_CREATED);
return $this->respondAsResource(UserConductor::model($request, $user), ['respondCode' => HttpResponseCodes::HTTP_CREATED]);
} else {
return $this->respondForbidden();
}