Skip to content

Commit

Permalink
fix(webAPI): Broken mapping when creating Transmissions in an Update (#…
Browse files Browse the repository at this point in the history
…1221)

<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

## Related Issue(s)

- #1220 

## Verification

- [ ] **Your** code builds clean without any errors or warnings
- [ ] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)

## Documentation

- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)
  • Loading branch information
oskogstad authored Oct 3, 2024
1 parent ee90c68 commit 6e7dfe4
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public MappingProfile()
CreateMap<UpdateDialogContentDto?, List<DialogContent>?>()
.ConvertUsing<DialogContentInputConverter<UpdateDialogContentDto>>();

// Since these are append only, we don't need to merge with existing
// Since these are append-only, we don't need to merge with existing
// activity/transmission records and thus can map complex properties
CreateMap<UpdateDialogDialogActivityDto, DialogActivity>()
.ForMember(dest => dest.Type, opt => opt.Ignore())
Expand All @@ -70,23 +70,21 @@ public MappingProfile()
.ForMember(dest => dest.ActorType, opt => opt.Ignore())
.ForMember(dest => dest.ActorTypeId, opt => opt.MapFrom(src => src.ActorType));

CreateMap<UpdateDialogDialogTransmissionDto, DialogTransmission>()
.ForMember(dest => dest.Type, opt => opt.Ignore())
.ForMember(dest => dest.TypeId, opt => opt.MapFrom(src => src.Type));

CreateMap<UpdateDialogDialogTransmissionContentDto?, List<DialogTransmissionContent>?>()
.ConvertUsing<TransmissionContentInputConverter<UpdateDialogDialogTransmissionContentDto>>();

CreateMap<UpdateDialogDialogTransmissionSenderActorDto, DialogTransmissionSenderActor>()
.ForMember(dest => dest.ActorType, opt => opt.Ignore())
.ForMember(dest => dest.ActorTypeId, opt => opt.MapFrom(src => src.ActorType));

CreateMap<UpdateDialogDialogTransmissionDto, DialogTransmission>()
.ForMember(dest => dest.Type, opt => opt.Ignore())
.ForMember(dest => dest.TypeId, opt => opt.MapFrom(src => src.Type));

CreateMap<UpdateDialogTransmissionAttachmentDto, DialogTransmissionAttachment>()
.IgnoreComplexDestinationProperties()
.ForMember(x => x.Id, opt => opt.Ignore());

CreateMap<UpdateDialogTransmissionAttachmentUrlDto, AttachmentUrl>()
.IgnoreComplexDestinationProperties()
.ForMember(x => x.Id, opt => opt.Ignore())
.ForMember(dest => dest.ConsumerType, opt => opt.Ignore())
.ForMember(dest => dest.ConsumerTypeId, opt => opt.MapFrom(src => src.ConsumerType));
Expand Down

0 comments on commit 6e7dfe4

Please sign in to comment.