mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 18:27:16 -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();
|
$entity = $request->entity();
|
||||||
$action = $request->action;
|
$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");
|
return $this->errorResponse("Action [$action] is not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'mark_sent') {
|
||||||
|
$action = 'markSent';
|
||||||
|
}
|
||||||
|
|
||||||
$repo = Utils::toCamelCase($this->entityType) . 'Repo';
|
$repo = Utils::toCamelCase($this->entityType) . 'Repo';
|
||||||
|
|
||||||
$this->$repo->$action($entity);
|
$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 \
|
curl -X PUT ninja.dev/api/v1/invoices/1?action=archive \
|
||||||
-H "X-Ninja-Token: TOKEN"
|
-H "X-Ninja-Token: TOKEN"
|
||||||
|
|
||||||
|
.. TIP:: For invoices use `mark_sent` to manually mark the invoice as sent
|
||||||
|
|
||||||
Emailing Invoices
|
Emailing Invoices
|
||||||
"""""""""""""""""
|
"""""""""""""""""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user