mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
refactor: improve search user collections logic to handle optional keyword
This commit is contained in:
@@ -136,7 +136,7 @@ func ListCollectionResources(collectionID uint, page int) ([]*model.ResourceView
|
||||
// Search user collections by keyword, limited to 10 results.
|
||||
// excludedRID: if >0, only return collections not containing this resource.
|
||||
func SearchUserCollections(username string, keyword string, excludedRID uint) ([]*model.CollectionView, error) {
|
||||
if username == "" || keyword == "" {
|
||||
if username == "" {
|
||||
return nil, errors.New("invalid parameters")
|
||||
}
|
||||
user, err := dao.GetUserByUsername(username)
|
||||
|
Reference in New Issue
Block a user