chore: cache username
This commit is contained in:
1 parent
d72d8852cd
commit
5eaa5bf050
4 files changed
+40
-8
No files matched your search
+3
-3
@@ -452,7 +452,7 @@ func updateUserRequestCount(id int, count int) {
|
||||
}
|
||||
}
|
||||
|
||||
func GetUsernameById(id int) (username string) {
|
||||
DB.Model(&User{}).Where("id = ?", id).Select("username").Find(&username)
|
||||
return username
|
||||
func GetUsernameById(id int) (username string, err error) {
|
||||
err = DB.Model(&User{}).Where("id = ?", id).Select("username").Find(&username).Error
|
||||
return username, err
|
||||
}
|
||||
Reference in new issue
Block a user