1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Merge pull request #629 from turbo124/master

return archived invoice as success
This commit is contained in:
David Bomba 2016-01-15 14:06:33 +11:00
commit 7b61c8a46d

View File

@ -276,10 +276,15 @@ class InvoiceApiController extends BaseAPIController
if ($request->action == ACTION_ARCHIVE) { if ($request->action == ACTION_ARCHIVE) {
$invoice = Invoice::scope($publicId)->firstOrFail(); $invoice = Invoice::scope($publicId)->firstOrFail();
$this->invoiceRepo->archive($invoice); $this->invoiceRepo->archive($invoice);
/*
$response = json_encode(RESULT_SUCCESS, JSON_PRETTY_PRINT); $response = json_encode(RESULT_SUCCESS, JSON_PRETTY_PRINT);
$headers = Utils::getApiHeaders(); $headers = Utils::getApiHeaders();
return Response::make($response, 200, $headers); return Response::make($response, 200, $headers);
*/
$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();