Skip to content

Commit 15e6b3f

Browse files
committed
refactor: rename PriceAgent to PriceAgentID
1 parent ae35058 commit 15e6b3f

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

internal/bot/bot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func showPriceagentDetail(b *gotgbot.Bot, ctx *ext.Context) error {
184184
return fmt.Errorf("showPriceagentDetail: failed to parse callback data: %w", parseErr)
185185
}
186186

187-
priceagent, dbErr := database.GetPriceagentForUserByID(ctx.EffectiveUser.Id, menu.PriceAgent)
187+
priceagent, dbErr := database.GetPriceagentForUserByID(ctx.EffectiveUser.Id, menu.PriceAgentID)
188188
if dbErr != nil {
189189
return fmt.Errorf("showPriceagentDetail: failed to get priceagent from database: %w", dbErr)
190190
}

internal/bot/models/menu.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import (
77
)
88

99
type Menu struct {
10-
ID string
11-
SubMenu string
12-
PriceAgent int64
13-
Extra string
10+
ID string
11+
SubMenu string
12+
PriceAgentID int64
13+
Extra string
1414
}
1515

1616
// NewMenu returns a menu struct from a given menuData string. The menu follows the format <menuID>_<submenuID>_<priceagentID>[_<extraData>]
@@ -29,9 +29,9 @@ func NewMenu(menuData string) (*Menu, error) {
2929
}
3030

3131
menu := &Menu{
32-
ID: components[0],
33-
SubMenu: components[1],
34-
PriceAgent: int64(priceagentID),
32+
ID: components[0],
33+
SubMenu: components[1],
34+
PriceAgentID: int64(priceagentID),
3535
}
3636

3737
if len(components) == 4 {

0 commit comments

Comments
 (0)