Enable merging address in a domain that has flatten set
This commit is contained in:
@@ -42,7 +42,11 @@ class AddressMerge extends FormRequest
|
||||
$dst = Address::withTrashed()->findOrFail($value);
|
||||
$src = Address::withTrashed()->findOrFail($request->src);
|
||||
|
||||
if ($src->ftn !== $dst->ftn)
|
||||
if ($src->zone->domain->flatten && $dst->zone->domain->flatten) {
|
||||
if ((! $src->zone->domain->zones->pluck('id')->contains($dst->zone_id)) || (! $dst->zone->domain->zones->pluck('id')->contains($src->zone_id)))
|
||||
$fail('Source must be Destination\'s domain zone');
|
||||
|
||||
} elseif ($src->ftn !== $dst->ftn)
|
||||
$fail('Source and Destination must be the same FTN');
|
||||
},
|
||||
],
|
||||
|
Reference in New Issue
Block a user