go #49

Merged
niggl merged 96 commits from go into main 2024-12-12 15:11:31 +00:00
Showing only changes of commit b179541532 - Show all commits

View File

@ -62,17 +62,16 @@ func GenerateCard(c *fiber.Ctx) error {
})
}
c.Set(fiber.HeaderContentType, "text/html")
return c.SendString(result)
// converter := services.GotenbergConverter{BaseUrl: "http://localhost:3001"}
// pdf, err := converter.ToPdf(result, "a4", false)
// if err != nil {
// return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
// "error": err.Error(),
// })
// }
converter := services.GotenbergConverter{BaseUrl: "http://localhost:3001"}
pdf, err := converter.ToPdf(result, "a4", false)
if err != nil {
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
"error": err.Error(),
})
}
// c.Set(fiber.HeaderContentType, "application/pdf")
// return c.Send(pdf)
c.Set(fiber.HeaderContentType, "application/pdf")
return c.Send(pdf)
}
func invertCardArrayItems(cards []models.Card) []models.Card {