mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 13:14:30 -04:00
Add mark_sent to the API
This commit is contained in:
parent
d37e2b90a0
commit
482b5ed0e3
@ -74,10 +74,14 @@ class BaseAPIController extends Controller
|
||||
$entity = $request->entity();
|
||||
$action = $request->action;
|
||||
|
||||
if (! in_array($action, ['archive', 'delete', 'restore'])) {
|
||||
if (! in_array($action, ['archive', 'delete', 'restore', 'mark_sent'])) {
|
||||
return $this->errorResponse("Action [$action] is not supported");
|
||||
}
|
||||
|
||||
if ($action == 'mark_sent') {
|
||||
$action = 'markSent';
|
||||
}
|
||||
|
||||
$repo = Utils::toCamelCase($this->entityType) . 'Repo';
|
||||
|
||||
$this->$repo->$action($entity);
|
||||
|
@ -115,6 +115,8 @@ You can archive, delete or restore an entity by setting ``action`` in the reques
|
||||
curl -X PUT ninja.dev/api/v1/invoices/1?action=archive \
|
||||
-H "X-Ninja-Token: TOKEN"
|
||||
|
||||
.. TIP:: For invoices use `mark_sent` to manually mark the invoice as sent
|
||||
|
||||
Emailing Invoices
|
||||
"""""""""""""""""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user