diff --git a/backend/internal/dto/dto_mapper.go b/backend/internal/dto/dto_mapper.go index 7769451..b84f1f4 100644 --- a/backend/internal/dto/dto_mapper.go +++ b/backend/internal/dto/dto_mapper.go @@ -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 {