Skip to content

Commit

Permalink
fix: deletemany empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Feb 20, 2024
1 parent 3eb6322 commit b22917a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/repository/image/image.repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@ func (r *repositoryImpl) Delete(id string) error {
return r.db.Where("id = ?", id).Delete(&model.Image{}).Error
}
func (r *repositoryImpl) DeleteMany(ids []string) error {
if len(ids) == 0 {
return nil
}
return r.db.Delete(&model.Image{}, ids).Error
}

0 comments on commit b22917a

Please sign in to comment.