()
| 416 | } |
| 417 | |
| 418 | func (a App) submitPricingQuery() (tea.Model, tea.Cmd) { |
| 419 | if a.pricingView.Loading { |
| 420 | return a, nil |
| 421 | } |
| 422 | b := &a.pricingView.CommandBuilder |
| 423 | products := append([]string{}, b.ProductTags...) |
| 424 | regions := append([]string{}, b.RegionTags...) |
| 425 | prices := append([]string{}, b.PriceTags...) |
| 426 | attrsMap := map[string]string{} |
| 427 | for _, tag := range b.AttributeTags { |
| 428 | if k, v, ok := strings.Cut(tag, "="); ok { |
| 429 | attrsMap[k] = v |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | a.pendingCacheProducts = products |
| 434 | a.pendingCacheRegions = regions |
| 435 | a.pendingCacheAttrs = attrsMap |
| 436 | a.pendingCachePrices = prices |
| 437 | a.pricingView.Loading = true |
| 438 | a.pricingView.ErrorMessage = "" |
| 439 | |
| 440 | return a, fetchPricingCmd(a.client, products, regions, attrsMap, prices) |
| 441 | } |
| 442 | |
| 443 | // View implements tea.Model. |
| 444 | func (a App) View() string { |
no test coverage detected