mirror of
https://github.com/tgdrive/teldrive.git
synced 2025-09-10 16:34:45 +08:00
fix: user stats listing
This commit is contained in:
parent
b82dac8820
commit
7a7743c63f
2 changed files with 3 additions and 9 deletions
|
@ -6,6 +6,6 @@ type Channel struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type AccountStats struct {
|
type AccountStats struct {
|
||||||
ChannelID int64 `json:"channelId"`
|
ChannelID int64 `json:"channelId,omitempty"`
|
||||||
Bots []string `json:"bots"`
|
Bots []string `json:"bots"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,14 +85,8 @@ func (us *UserService) GetStats(c *gin.Context) (*schemas.AccountStats, *types.A
|
||||||
channelId int64
|
channelId int64
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if c.Param("channelId") != "" {
|
|
||||||
channelId, _ = strconv.ParseInt(c.Param("channelId"), 10, 64)
|
channelId, _ = GetDefaultChannel(c, us.db, userID)
|
||||||
} else {
|
|
||||||
channelId, err = GetDefaultChannel(c, us.db, userID)
|
|
||||||
if err != nil {
|
|
||||||
return nil, &types.AppError{Error: err, Code: http.StatusInternalServerError}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tokens, err := getBotsToken(c, us.db, userID, channelId)
|
tokens, err := getBotsToken(c, us.db, userID, channelId)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue