mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -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;
|
<?php namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||||
use Utils;
|
use Utils;
|
||||||
use Response;
|
use Response;
|
||||||
use Input;
|
use Input;
|
||||||
@ -134,10 +135,12 @@ class ClientApiController extends BaseAPIController
|
|||||||
public function update(UpdateClientRequest $request, $publicId)
|
public function update(UpdateClientRequest $request, $publicId)
|
||||||
{
|
{
|
||||||
if ($request->action == ACTION_ARCHIVE) {
|
if ($request->action == ACTION_ARCHIVE) {
|
||||||
$client = Client::scope($publicId)->withTrashed()->first();
|
|
||||||
|
|
||||||
if(!$client)
|
try {
|
||||||
return $this->errorResponse(['message'=>'Client not found.']);
|
$client = Client::scope($publicId)->withTrashed()->firstOrFail();
|
||||||
|
} catch (ModelNotFoundException $e) {
|
||||||
|
return $this->errorResponse(['message'=>'Record not found'], 400);
|
||||||
|
}
|
||||||
|
|
||||||
$this->clientRepo->archive($client);
|
$this->clientRepo->archive($client);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user