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); return $this->response($data);
} }
else if ($request->action == ACTION_RESTORE) { else if ($request->action == ACTION_RESTORE) {
$invoice = Invoice::scope($publicId)->firstOrFail(); $invoice = Invoice::scope($publicId)->withTrashed()->firstOrFail();
$invoice = $this->invoiceRepo->restore($invoice); $this->invoiceRepo->restore($invoice);
$transformer = new InvoiceTransformer(\Auth::user()->account, Input::get('serializer')); $transformer = new InvoiceTransformer(\Auth::user()->account, Input::get('serializer'));
$data = $this->createItem($invoice, $transformer, 'invoice'); $data = $this->createItem($invoice, $transformer, 'invoice');