code simplification

This commit is contained in:
bronkuu 2026-06-15 20:00:04 +02:00
parent be80307bde
commit cf2e217030
7 changed files with 47 additions and 73 deletions

View file

@ -85,11 +85,7 @@ func (s *Store) SaveSpecialCakes(tx *sql.Tx, orderID int, cakes []models.Special
if err != nil {
return err
}
tagIDs := make([]int, len(sc.Tags))
for i, t := range sc.Tags {
tagIDs[i] = t.ID
}
if err := s.saveSpecialCakeTags(tx, int(id), tagIDs); err != nil {
if err := s.saveSpecialCakeTags(tx, int(id), tagIDs(sc.Tags)); err != nil {
return err
}
}