mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 00:34:37 -04:00
Add 'action' to API docs
This commit is contained in:
parent
c433661d11
commit
827b93e40c
@ -74,6 +74,10 @@ class BaseAPIController extends Controller
|
||||
$entity = $request->entity();
|
||||
$action = $request->action;
|
||||
|
||||
if (! in_array($action, ['archive', 'delete', 'restore'])) {
|
||||
return $this->errorResponse('Action is not supported');
|
||||
}
|
||||
|
||||
$repo = Utils::toCamelCase($this->entityType) . 'Repo';
|
||||
|
||||
$this->$repo->$action($entity);
|
||||
|
@ -107,6 +107,11 @@ Updating Data
|
||||
-d '{"name":"test", "contacts":[{"id": 1, "first_name": "test"}]}' \
|
||||
-H "X-Ninja-Token: TOKEN"
|
||||
|
||||
You can archive, delete or restore an entity by setting ``action`` in the request
|
||||
|
||||
curl -X PUT ninja.dev/api/v1/invoices/1?action=archive \
|
||||
-H "X-Ninja-Token: TOKEN"
|
||||
|
||||
Emailing Invoices
|
||||
"""""""""""""""""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user