1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Restore Invoice from API

This commit is contained in:
David Bomba 2016-01-28 13:31:19 +11:00
parent 165a382637
commit cae3b48cd4

View File

@ -317,8 +317,8 @@ class InvoiceApiController extends BaseAPIController
return $this->response($data);
}
else if ($request->action == ACTION_RESTORE) {
$invoice = Invoice::scope($publicId)->firstOrFail();
$invoice = $this->invoiceRepo->restore($invoice);
$invoice = Invoice::scope($publicId)->withTrashed()->firstOrFail();
$this->invoiceRepo->restore($invoice);
$transformer = new InvoiceTransformer(\Auth::user()->account, Input::get('serializer'));
$data = $this->createItem($invoice, $transformer, 'invoice');