@ -199,28 +199,28 @@ func FetchLastLoggedInDateByUsername(username string) (string, error) {
}
}
type AdminSearchResponse struct {
type AdminSearchResponse struct {
Username string ` json:"username" `
Username string ` json:"username" `
DiscordId string ` json:"discordId" `
DiscordId string ` json:"discordId" `
GoogleId string ` json:"googleId" `
GoogleId string ` json:"googleId" `
Last LoggedIn string ` json:"lastLoggedIn" `
Last Activity string ` json:"lastLoggedIn" ` // TODO: this is currently lastLoggedIn to match server PR #54 with pokerogue PR #4198. We're hotfixing the server with this PR to return lastActivity, but we're not hotfixing the client, so are leaving this as lastLoggedIn so that it still talks to the client properly
Registered string ` json:"registered" `
Registered string ` json:"registered" `
}
}
func FetchAdminDetailsByUsername ( dbUsername string ) ( AdminSearchResponse , error ) {
func FetchAdminDetailsByUsername ( dbUsername string ) ( AdminSearchResponse , error ) {
var resultUsername, resultDiscordId , resultGoogleId , resultLastLoggedIn , resultR egistered sql . NullString
var username, discordId , googleId , lastActivity , r egistered sql . NullString
var adminResponse AdminSearchResponse
var adminResponse AdminSearchResponse
err := handle . QueryRow ( "SELECT username, discordId, googleId, last LoggedIn , registered from accounts WHERE username = ?", dbUsername ) . Scan ( & resultUsername, & resultDiscordId , & resultGoogleId , & resultLastLoggedIn , & resultR egistered)
err := handle . QueryRow ( "SELECT username, discordId, googleId, last Activity , registered from accounts WHERE username = ?", dbUsername ) . Scan ( & username, & discordId , & googleId , & lastActivity , & r egistered)
if err != nil {
if err != nil {
return adminResponse , err
return adminResponse , err
}
}
adminResponse = AdminSearchResponse {
adminResponse = AdminSearchResponse {
Username : res ultU sername. String ,
Username : username. String ,
DiscordId : resultD iscordId. String ,
DiscordId : d iscordId. String ,
GoogleId : resultG oogleId. String ,
GoogleId : g oogleId. String ,
Last LoggedIn: resultLastLoggedIn . String ,
Last Activity: lastActivity . String ,
Registered : resultR egistered. String ,
Registered : r egistered. String ,
}
}
return adminResponse , nil
return adminResponse , nil