File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Then, to load the plugin either run the following command:
2020bin/cake plugin load JsonApiException
2121```
2222
23- or manually add the following line to your app's ` src/Application.php ` file's ` bootstrap() ` function:
23+ or manually add the following line to your app's ` src/Application.php ` file's ` bootstrap() ` function:
2424
2525``` php
2626$this->addPlugin('JsonApiException');
@@ -43,6 +43,7 @@ public function add()
4343 $user = $this->Users->patchEntity($user, $this->request->getData());
4444 if (!$this->Users->save($user)) {
4545 throw new JsonApiException($user, 'Save failed');
46+ // throw new JsonApiException($user, 'Save failed', 418); // you set the response's status code in the 3rd parameter
4647 }
4748 }
4849 $this->set(compact('user'));
You can’t perform that action at this time.
0 commit comments