Skip to content

Commit

Permalink
fix: empty lists don't get returned correctly from the api
Browse files Browse the repository at this point in the history
  • Loading branch information
stonith404 committed Aug 24, 2024
1 parent fc47c2a commit 97f7fc4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/internal/dto/dto_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (

// MapStructList maps a list of source structs to a list of destination structs
func MapStructList[S any, D any](source []S, destination *[]D) error {
*destination = make([]D, 0, len(source))

for _, item := range source {
var destItem D
if err := MapStruct(item, &destItem); err != nil {
Expand Down

0 comments on commit 97f7fc4

Please sign in to comment.