google api works!

This commit is contained in:
2026-03-16 10:32:11 +01:00
parent 72ac41cac0
commit 56a1495a0b
10 changed files with 46 additions and 72 deletions

View File

@@ -134,12 +134,13 @@ func (h *ProductDescriptionHandler) SaveProductDescription(c fiber.Ctx) error {
// GetProductDescription returns the product description for a given product ID
func (h *ProductDescriptionHandler) TranslateProductDescription(c fiber.Ctx) error {
userID, ok := c.Locals("userID").(uint)
if !ok {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)).JSON(fiber.Map{
"error": responseErrors.GetErrorCode(c, responseErrors.ErrInvalidBody), // possibly could return a different error
})
}
// userID, ok := c.Locals("userID").(uint)
// if !ok {
// return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)).JSON(fiber.Map{
// "error": responseErrors.GetErrorCode(c, responseErrors.ErrInvalidBody), // possibly could return a different error
// })
// }
userID := uint(0)
productID_attribute := c.Query("productID")
productID, err := strconv.Atoi(productID_attribute)