Merge pull request #664 from turbo124/master

Restore and invoice from the API
This commit is contained in:
David Bomba 2016-01-28 13:50:48 +11:00
commit 76683e10b2

View File

@ -316,6 +316,15 @@ class InvoiceApiController extends BaseAPIController
return $this->response($data); return $this->response($data);
} }
else if ($request->action == ACTION_RESTORE) {
$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');
return $this->response($data);
}
$data = $request->input(); $data = $request->input();
$data['public_id'] = $publicId; $data['public_id'] = $publicId;