mirror of
https://github.com/tgdrive/teldrive.git
synced 2025-09-07 23:14:41 +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 {
|
||||
ChannelID int64 `json:"channelId"`
|
||||
ChannelID int64 `json:"channelId,omitempty"`
|
||||
Bots []string `json:"bots"`
|
||||
}
|
||||
|
|
|
@ -85,14 +85,8 @@ func (us *UserService) GetStats(c *gin.Context) (*schemas.AccountStats, *types.A
|
|||
channelId int64
|
||||
err error
|
||||
)
|
||||
if c.Param("channelId") != "" {
|
||||
channelId, _ = strconv.ParseInt(c.Param("channelId"), 10, 64)
|
||||
} else {
|
||||
channelId, err = GetDefaultChannel(c, us.db, userID)
|
||||
if err != nil {
|
||||
return nil, &types.AppError{Error: err, Code: http.StatusInternalServerError}
|
||||
}
|
||||
}
|
||||
|
||||
channelId, _ = GetDefaultChannel(c, us.db, userID)
|
||||
|
||||
tokens, err := getBotsToken(c, us.db, userID, channelId)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue