домен обновлен

This commit is contained in:
Artem Tsyrulnikov
2026-01-07 15:11:28 +03:00
parent f6669c3f5a
commit e4199fc9c9
30 changed files with 696 additions and 1201 deletions

View File

@@ -1283,9 +1283,13 @@ func (s *PurchaseOptionalDetails) createPurchase(b *bot.Bot, jwt string) {
}
}
b.SendNew("✅ Закуп создан", bot.Keyboard(
bot.Row(bot.Button("● Готово", "done")),
))
b.SetState(&PurchaseDetails{
WorkspaceID: s.WorkspaceID,
ProjectID: s.ProjectID,
ProjectTitle: s.ProjectTitle,
PurchaseID: purchase.ID,
BackState: s.BackState,
}, bot.NewMessage)
}
func (s *PurchaseOptionalDetails) buildPurchaseDetails(purchaseType *string) *backend.PurchaseDetails {
@@ -1449,5 +1453,15 @@ func (s *PurchaseOptionalDetails) injectInviteLink(text, inviteLink string) stri
return text
}
re := regexp.MustCompile(`<a\s+class="tg-link">([^<]*)</a>`)
return re.ReplaceAllString(text, fmt.Sprintf(`<a href="%s">$1</a>`, inviteLink))
return re.ReplaceAllStringFunc(text, func(match string) string {
sub := re.FindStringSubmatch(match)
if len(sub) < 2 {
return match
}
inner := strings.TrimSpace(sub[1])
if inner == "" {
return fmt.Sprintf(`<a href="%s">%s</a>`, inviteLink, inviteLink)
}
return fmt.Sprintf(`<a href="%s">%s</a>`, inviteLink, sub[1])
})
}