Fix translation of carousel slides when changing media ID

I was trying to translate the slides that i just deleted before.
This commit is contained in:
jordi fita mas 2024-01-22 21:03:00 +01:00
parent 17aaf045bb
commit d96f62a0a3
1 changed files with 1 additions and 0 deletions

View File

@ -238,6 +238,7 @@ func editSlide(w http.ResponseWriter, r *http.Request, user *auth.User, company
if _, err := tx.Exec(ctx, fmt.Sprintf("select remove_%s_carousel_slide($1)", f.CarouselName), f.ID); err != nil {
return err
}
f.ID = f.Media.Int() // for translateSlide
}
return translateSlide(ctx, tx, company, f)
})