1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Fix data import

This commit is contained in:
Hillel Coren 2016-12-22 19:12:12 +02:00
parent 3a845a54e7
commit b7465a8f17

View File

@ -1,7 +1,6 @@
<?php namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request as InputRequest;
use Response;
use App\Libraries\Utils;
@ -11,11 +10,6 @@ abstract class Request extends FormRequest {
// populate in subclass to auto load record
protected $autoload = [];
public function __construct(InputRequest $req)
{
$this->req = $req;
}
/**
* Validate the input.
*
@ -60,8 +54,9 @@ abstract class Request extends FormRequest {
public function response(array $errors)
{
/* If the user is not validating from a mobile app - pass through parent::response */
if(!isset($this->req->api_secret))
if ( ! request()->api_secret) {
return parent::response($errors);
}
/* If the user is validating from a mobile app - pass through first error string and return error */
foreach($errors as $error) {