|
@@ -18,9 +18,9 @@ class NameRuleImport implements ToCollection, WithHeadingRow
|
|
|
{
|
|
|
$group=request()->group;
|
|
|
$namingRule = NamingRule::query()->where("company_id", Auth::user()->company_id)->where("id", $group)->first();
|
|
|
- if (! $namingRule) {
|
|
|
- return $this->forbidden('Naming rule does not exist');
|
|
|
- }
|
|
|
+
|
|
|
+ throw_validation_if($namingRule==null, "Naming rule does not exist");
|
|
|
+
|
|
|
$requestRule = new CreateOrUpdateRequest();
|
|
|
|
|
|
$this->validatorByCollection($collection,$requestRule->importRules());
|