code simplification
This commit is contained in:
parent
be80307bde
commit
cf2e217030
7 changed files with 47 additions and 73 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue