Skip to content

Commit 647192c

Browse files
committed
Fixes for search, showing the attribute name - fix after we record all names for an attribute in a single object
1 parent 725589a commit 647192c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/Http/Controllers/SearchController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ public function search(Request $request): Collection
4444
} else {
4545
$attrs = $so
4646
->schema('attributetypes')
47-
->sortBy('name')
48-
->filter(fn($item)=>Str::contains($item->name_lc,strtolower($request->term)));
47+
->sortBy('names_lc')
48+
->filter(fn($item)=>Str::contains($item->names_lc,strtolower($request->term)));
4949

5050
return $attrs
5151
->map(fn($item)=>[
52-
'name'=>$item->name,
52+
'name'=>$item->names->first(),
5353
'value'=>'',
5454
'category'=>__('Select attribute...')
5555
])

0 commit comments

Comments
 (0)