mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 08:24:39 -04:00
commit
2db27caf90
@ -133,9 +133,19 @@ class ClientApiController extends BaseAPIController
|
||||
|
||||
public function update(UpdateClientRequest $request, $publicId)
|
||||
{
|
||||
if ($request->action == ACTION_ARCHIVE) {
|
||||
$client = Client::scope($publicId)->firstOrFail();
|
||||
$this->clientRepo->archive($client);
|
||||
|
||||
$transformer = new ClientTransformer(Auth::user()->account, Input::get('serializer'));
|
||||
$data = $this->createItem($client, $transformer, ENTITY_CLIENT);
|
||||
|
||||
return $this->response($data);
|
||||
}
|
||||
|
||||
$data = $request->input();
|
||||
$data['public_id'] = $publicId;
|
||||
$this->clientService->save($data);
|
||||
$this->clientRepo->save($data);
|
||||
|
||||
$client = Client::scope($publicId)
|
||||
->with('country', 'contacts', 'industry', 'size', 'currency')
|
||||
|
@ -297,11 +297,7 @@ class InvoiceApiController extends BaseAPIController
|
||||
if ($request->action == ACTION_ARCHIVE) {
|
||||
$invoice = Invoice::scope($publicId)->firstOrFail();
|
||||
$this->invoiceRepo->archive($invoice);
|
||||
/*
|
||||
$response = json_encode(RESULT_SUCCESS, JSON_PRETTY_PRINT);
|
||||
$headers = Utils::getApiHeaders();
|
||||
return Response::make($response, 200, $headers);
|
||||
*/
|
||||
|
||||
$transformer = new InvoiceTransformer(\Auth::user()->account, Input::get('serializer'));
|
||||
$data = $this->createItem($invoice, $transformer, 'invoice');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user