Restore an invoice from the API

This commit is contained in:
David Bomba 2016-01-28 12:55:15 +11:00
parent 8d6b4af8ba
commit 165a382637

View File

@ -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;