mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Restore an invoice from the API
This commit is contained in:
parent
8d6b4af8ba
commit
165a382637
@ -316,6 +316,15 @@ class InvoiceApiController extends BaseAPIController
|
||||
|
||||
return $this->response($data);
|
||||
}
|
||||
else if ($request->action == ACTION_RESTORE) {
|
||||
$invoice = Invoice::scope($publicId)->firstOrFail();
|
||||
$invoice = $this->invoiceRepo->restore($invoice);
|
||||
|
||||
$transformer = new InvoiceTransformer(\Auth::user()->account, Input::get('serializer'));
|
||||
$data = $this->createItem($invoice, $transformer, 'invoice');
|
||||
|
||||
return $this->response($data);
|
||||
}
|
||||
|
||||
$data = $request->input();
|
||||
$data['public_id'] = $publicId;
|
||||
|
Loading…
x
Reference in New Issue
Block a user