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:
parent
17aaf045bb
commit
d96f62a0a3
|
@ -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 {
|
if _, err := tx.Exec(ctx, fmt.Sprintf("select remove_%s_carousel_slide($1)", f.CarouselName), f.ID); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
f.ID = f.Media.Int() // for translateSlide
|
||||||
}
|
}
|
||||||
return translateSlide(ctx, tx, company, f)
|
return translateSlide(ctx, tx, company, f)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue