Fix search

This commit is contained in:
2025-09-08 20:24:57 +08:00
parent faa802dd72
commit 5bf2544282
2 changed files with 20 additions and 1 deletions

View File

@@ -325,6 +325,21 @@ func SearchResource(query string, page int) ([]model.ResourceView, int, error) {
}
resources = append(resources, temp...)
// remove duplicates
temp = make([]uint, 0)
for _, id := range resources {
found := false
for _, id2 := range temp {
if id == id2 {
found = true
break
}
}
if !found {
temp = append(temp, id)
}
}
if start >= len(resources) {
return []model.ResourceView{}, 0, nil
}