закупы в бэк
This commit is contained in:
@@ -221,10 +221,20 @@ func (s *SelectChannelsForPurchase) createPurchase(b *bot.Bot, jwt string) {
|
||||
// Преобразуем каналы в формат API
|
||||
var apiChannels []backend.CreatePurchaseChannelInput
|
||||
for _, ch := range s.Channels {
|
||||
var details *backend.PurchaseChannelDetails
|
||||
if ch.PlannedCost != nil {
|
||||
cost := backend.CostInfo{
|
||||
Type: "fixed",
|
||||
Value: *ch.PlannedCost,
|
||||
}
|
||||
details = &backend.PurchaseChannelDetails{
|
||||
Cost: &cost,
|
||||
}
|
||||
}
|
||||
apiChannels = append(apiChannels, backend.CreatePurchaseChannelInput{
|
||||
Username: ch.Username,
|
||||
PlannedCost: ch.PlannedCost,
|
||||
Comment: ch.Comment,
|
||||
Username: ch.Username,
|
||||
Comment: ch.Comment,
|
||||
Details: details,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user