Skip to content

Commit

Permalink
Fix bug in Work Entry edit page
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwaldron committed Jul 5, 2024
1 parent 1af0ab4 commit 59a6d03
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/AppServices/AutoMapper/AutoMapperProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public AutoMapperProfile()

CreateMap<WorkEntry, WorkEntrySearchResultDto>();
CreateMap<WorkEntry, WorkEntryCreateDto>();
CreateMap<WorkEntry, WorkEntryUpdateDto>();
CreateMap<WorkEntry, WorkEntryViewDto>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace MyApp.AppServices.WorkEntries.CommandDto;

public record WorkEntryCreateDto : IWorkEntryCommandDto
{
[Display(Name = "Entry Type")]
public Guid EntryTypeId { get; init; }

[DataType(DataType.MultilineText)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public record WorkEntryUpdateDto : IWorkEntryCommandDto
public bool IsDeleted { get; init; }

// Data
[Display(Name = "Entry Type")]
public Guid EntryTypeId { get; init; }

[DataType(DataType.MultilineText)]
Expand Down
12 changes: 12 additions & 0 deletions src/AppServices/WorkEntries/Validators/WorkEntryUpdateValidator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using FluentValidation;
using MyApp.AppServices.WorkEntries.CommandDto;

namespace MyApp.AppServices.WorkEntries.Validators;

public class WorkEntryUpdateValidator : AbstractValidator<WorkEntryUpdateDto>
{
public WorkEntryUpdateValidator()
{
RuleFor(dto => dto.Notes).NotEmpty();
}
}

0 comments on commit 59a6d03

Please sign in to comment.