mirror of
https://github.com/linux-do/new-api.git
synced 2025-10-17 21:03:41 +08:00
chore: make the user unable to search token by id
This commit is contained in:
@@ -28,7 +28,7 @@ func GetAllUserTokens(userId int, startIdx int, num int) ([]*Token, error) {
|
||||
}
|
||||
|
||||
func SearchUserTokens(userId int, keyword string) (tokens []*Token, err error) {
|
||||
err = DB.Where("user_id = ?", userId).Where("id = ? or name LIKE ?", keyword, keyword+"%").Find(&tokens).Error
|
||||
err = DB.Where("user_id = ?", userId).Where("name LIKE ?", keyword+"%").Find(&tokens).Error
|
||||
return tokens, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user