mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Bug fixes
This commit is contained in:
parent
6747e56b71
commit
0fa30fb55f
@ -60,10 +60,11 @@ class InvoiceApiController extends Controller
|
||||
}
|
||||
|
||||
if (isset($data['email'])) {
|
||||
$contact = Contact::scope()->with('client')->whereEmail($data['email'])->first();
|
||||
if ($contact) {
|
||||
$client = $contact->client;
|
||||
} else {
|
||||
$client = Client::scope()->whereHas('contacts', function($query) use ($data) {
|
||||
$query->where('email', '=', $data['email']);
|
||||
})->first();
|
||||
|
||||
if (!$client) {
|
||||
$clientData = ['contact' => ['email' => $data['email']]];
|
||||
foreach (['name', 'private_notes'] as $field) {
|
||||
if (isset($data[$field])) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php namespace app\Http\Middleware;
|
||||
|
||||
use Request;
|
||||
use Closure;
|
||||
use Utils;
|
||||
use App;
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Routes
|
||||
|
Loading…
x
Reference in New Issue
Block a user