mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 18:34:28 -04:00
Adding back change from conflict
This commit is contained in:
parent
2de09d9835
commit
2295102b98
@ -1,5 +1,6 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Utils;
|
||||
use Response;
|
||||
use Input;
|
||||
@ -134,10 +135,12 @@ class ClientApiController extends BaseAPIController
|
||||
public function update(UpdateClientRequest $request, $publicId)
|
||||
{
|
||||
if ($request->action == ACTION_ARCHIVE) {
|
||||
$client = Client::scope($publicId)->withTrashed()->first();
|
||||
|
||||
if(!$client)
|
||||
return $this->errorResponse(['message'=>'Client not found.']);
|
||||
try {
|
||||
$client = Client::scope($publicId)->withTrashed()->firstOrFail();
|
||||
} catch (ModelNotFoundException $e) {
|
||||
return $this->errorResponse(['message'=>'Record not found'], 400);
|
||||
}
|
||||
|
||||
$this->clientRepo->archive($client);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user