forked from mirror/pixelfed
Update AdminShadowFilter, fix deleted profile bug
This commit is contained in:
parent
5c1591fdff
commit
a492a95a0e
2 changed files with 8 additions and 1 deletions
|
@ -19,7 +19,8 @@ class AdminShadowFilterController extends Controller
|
|||
{
|
||||
$filter = $request->input('filter');
|
||||
$searchQuery = $request->input('q');
|
||||
$filters = AdminShadowFilter::when($filter, function($q, $filter) {
|
||||
$filters = AdminShadowFilter::whereHas('profile')
|
||||
->when($filter, function($q, $filter) {
|
||||
if($filter == 'all') {
|
||||
return $q;
|
||||
} else if($filter == 'inactive') {
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace App\Models;
|
|||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Services\AccountService;
|
||||
use App\Profile;
|
||||
|
||||
class AdminShadowFilter extends Model
|
||||
{
|
||||
|
@ -24,4 +25,9 @@ class AdminShadowFilter extends Model
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
public function profile()
|
||||
{
|
||||
return $this->belongsTo(Profile::class, 'item_id');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue