style(database): change DBQueryUsers to DBListUsers

This commit is contained in:
2026-04-04 11:49:59 +08:00
parent de6a8cdcb0
commit 671106d3bc
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -315,7 +315,7 @@ func InitUserDatabase(dbPath string) error {
return nil
}
func DBQueryUsers() ([]User, error) { // List all users
func DBListUsers() ([]User, error) { // List all users
rows, err := db.Query("SELECT userID, username, type, createdAt FROM userLogin")
if err != nil {
return nil, fmt.Errorf("failed to query users: %w", err)
+1 -1
View File
@@ -450,7 +450,7 @@ func ListUserHandler(w http.ResponseWriter, r *http.Request) {
return
}
userList, err := DBQueryUsers()
userList, err := DBListUsers()
if err != nil {
SendErrorResponse(w, http.StatusInternalServerError, "Failed to list users")
postLog.Error(fmt.Sprintf("[ListUserHandler] Failed to list users: %v", err))