fix: make untagged search work for no-js view too

This commit is contained in:
Floorb 2023-05-19 06:31:20 -04:00
parent 2bccaf408f
commit a1cbbc3587

View file

@ -35,10 +35,14 @@ $pastes = Paste::with([
if (!empty($filter_value)) { if (!empty($filter_value)) {
$pastes = $pastes->where('title', 'LIKE', '%' . escapeLikeQuery($filter_value) . '%') if ($filter_value === 'untagged') {
->orWhereHas('tags', function($q) use ($filter_value) { $pastes = $pastes->doesntHave('tags');
$q->where('name', 'LIKE', '%' . escapeLikeQuery($filter_value) . '%'); } else {
}); $pastes = $pastes->where('title', 'LIKE', '%' . escapeLikeQuery($filter_value) . '%')
->orWhereHas('tags', function($q) use ($filter_value) {
$q->where('name', 'LIKE', '%' . escapeLikeQuery($filter_value) . '%');
});
}
} }
$total_results = $pastes->count(); $total_results = $pastes->count();