Finish first round of User/Node API additions

Will still need some tweaking and improvements to allow everything to be used.
This commit is contained in:
Dane Everitt 2018-01-01 15:11:44 -06:00
parent d21f70c04b
commit 15289b76a7
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
10 changed files with 220 additions and 68 deletions

View file

@ -146,13 +146,17 @@ class UserController extends Controller
}
}
return $this->fractal->item($collection->get('user'))
$response = $this->fractal->item($collection->get('model'))
->transformWith(new UserTransformer($request))
->withResourceName('user')
->addMeta([
->withResourceName('user');
if (count($errors) > 0) {
$response->addMeta([
'revocation_errors' => $errors,
])
->toArray();
]);
}
return $response->toArray();
}
/**