Skip to content

Commit

Permalink
chore: make the user unable to search token by id
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed Jun 19, 2023
1 parent 75545a1 commit 5c18c55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion model/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/TokensTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const TokensTable = () => {
icon='search'
fluid
iconPosition='left'
placeholder='搜索令牌的 ID 和名称 ...'
placeholder='搜索令牌的名称 ...'
value={searchKeyword}
loading={searching}
onChange={handleKeywordChange}
Expand Down

0 comments on commit 5c18c55

Please sign in to comment.