refactor(handler): Move array manipulation
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Nicolai Ort 2024-12-17 16:07:40 +01:00
parent df9f7fdc13
commit 4d57cf827d
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F

View File

@ -37,8 +37,6 @@ func (h *DefaultHandler) GenerateContract(c *fiber.Ctx) error {
logger = logger.With("locale", contract.Locale) logger = logger.With("locale", contract.Locale)
contract.Runners = repeatRunnerArrayItems(contract.Runners, 2)
templateString, err := h.StaticService.GetTemplate(contract.Locale, "contract") templateString, err := h.StaticService.GetTemplate(contract.Locale, "contract")
if err != nil { if err != nil {
logger.Errorw("Template not found", "error", err) logger.Errorw("Template not found", "error", err)
@ -55,7 +53,7 @@ func (h *DefaultHandler) GenerateContract(c *fiber.Ctx) error {
} }
genConfig := &models.ContractTemplateOptions{ genConfig := &models.ContractTemplateOptions{
Runners: contract.Runners, Runners: repeatRunnerArrayItems(contract.Runners, 2),
CurrencySymbol: h.Config.CurrencySymbol, CurrencySymbol: h.Config.CurrencySymbol,
Disclaimer: h.Config.SponosringDisclaimer, Disclaimer: h.Config.SponosringDisclaimer,
ReceiptMinimumAmount: h.Config.SponsoringReceiptMinimum, ReceiptMinimumAmount: h.Config.SponsoringReceiptMinimum,