mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Clarify error if client not found
This commit is contained in:
parent
50e13378f0
commit
4362fd182a
@ -181,7 +181,11 @@ class InvoiceApiController extends BaseAPIController
|
||||
$client = $this->clientRepo->save($clientData);
|
||||
}
|
||||
} elseif (isset($data['client_id'])) {
|
||||
$client = Client::scope($data['client_id'])->firstOrFail();
|
||||
$client = Client::scope($data['client_id'])->first();
|
||||
|
||||
if (! $client) {
|
||||
return $this->errorResponse('Client not found', 404);
|
||||
}
|
||||
}
|
||||
|
||||
$data = self::prepareData($data, $client);
|
||||
|
Loading…
x
Reference in New Issue
Block a user