Update DomainBlockController, purge domainBlocks cache

This commit is contained in:
Daniel Supernault 2023-12-21 00:44:54 -07:00
parent 6d55cb27ee
commit 6d81214138
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -6,6 +6,7 @@ use Illuminate\Http\Request;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\UserDomainBlock; use App\Models\UserDomainBlock;
use App\Util\ActivityPub\Helpers; use App\Util\ActivityPub\Helpers;
use App\Services\UserFilterService;
use Illuminate\Bus\Batch; use Illuminate\Bus\Batch;
use Illuminate\Support\Facades\Bus; use Illuminate\Support\Facades\Bus;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
@ -90,6 +91,7 @@ class DomainBlockController extends Controller
])->allowFailures()->onQueue('feed')->dispatch(); ])->allowFailures()->onQueue('feed')->dispatch();
Cache::forget('profile:following:' . $pid); Cache::forget('profile:following:' . $pid);
UserFilterService::domainBlocks($pid, true);
} }
return $this->json([]); return $this->json([]);
@ -109,6 +111,8 @@ class DomainBlockController extends Controller
$filters = UserDomainBlock::whereProfileId($pid)->whereDomain($domain)->delete(); $filters = UserDomainBlock::whereProfileId($pid)->whereDomain($domain)->delete();
UserFilterService::domainBlocks($pid, true);
return $this->json([]); return $this->json([]);
} }
} }