Rename address:merge to address:purge, included merging file/echo subscriptions, updated web subscription cannot add echos to deleted ftns

This commit is contained in:
Deon George
2022-11-20 11:47:46 +11:00
parent ccf187d710
commit 102a972fcb
3 changed files with 49 additions and 6 deletions

View File

@@ -284,6 +284,7 @@ class SystemController extends Controller
->leftjoin('zones',['zones.id'=>'addresses.zone_id'])
->where('addresses.system_id',$o->id)
->where('zones.domain_id',$request->domain_id)
->withTrashed()
->FTNorder()
->get()
->map(function($item) { return ['id'=>(string)$item->id,'value'=>$item->ftn3d]; });
@@ -390,6 +391,9 @@ class SystemController extends Controller
if (($request->method() == 'POST') && $request->post()) {
session()->flash('accordion','echoarea');
if ($ao->trashed() && collect($request->get('id'))->diff($ao->echoareas->pluck('id'))->count())
return redirect()->back()->withErrors(sprintf('Address [%s] has been deleted, cannot add additional echos',$ao->ftn3d));
// Ensure we have session details for this address.
if (! $ao->session('sespass'))
return redirect()->back()->withErrors('System doesnt belong to this network');