fix: перенёс логику получения чужой истории на апи2

This commit is contained in:
skeris 2024-03-07 19:43:00 +03:00
parent ff6d9ce793
commit 98432999b6
2 changed files with 9 additions and 0 deletions

Binary file not shown.

@ -509,7 +509,16 @@ func (api *API2) UpdateCurrencies(ctx echo.Context) error {
// History
func (api *API2) GetHistory(ctx echo.Context, params GetHistoryParams) error {
var userID string
if params.AccountID != nil && *params.AccountID != "" {
userID = *params.AccountID
} else {
userID, _ = ctx.Get(models.AuthJWTDecodedUserIDKey).(string)
}
dto := &history.GetHistories{
UserID: userID,
Type: params.Type,
Pagination: &models.Pagination{
Page: int64(*params.Page),