Skip to content

Commit

Permalink
fix: rename request param to match with client
Browse files Browse the repository at this point in the history
  • Loading branch information
koenmetsu authored and CumpsD committed Feb 25, 2020
1 parent 54e0dbc commit 56a09a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ public async Task<IActionResult> Get([FromServices] OrganisationRegistryContext
[OrganisationRegistryAuthorize]
[ProducesResponseType(typeof(CreatedResult), (int)HttpStatusCode.Created)]
[ProducesResponseType(typeof(BadRequestResult), (int)HttpStatusCode.BadRequest)]
public async Task<IActionResult> Post([FromServices] OrganisationRegistryContext context, [FromServices] ISecurityService securityService, [FromBody] CreateOrganisationRequest message)
public async Task<IActionResult> Post(
[FromServices] ISecurityService securityService,
[FromBody] CreateOrganisationRequest message)
{
if (!securityService.CanAddOrganisation(User, message.ParentOrganisationId))
ModelState.AddModelError("NotAllowed", "U hebt niet voldoende rechten voor deze organisatie.");
Expand All @@ -97,7 +99,7 @@ public async Task<IActionResult> Post([FromServices] OrganisationRegistryContext
if (authInfo.Principal == null || !authInfo.Principal.IsInRole(Roles.Developer))
message.OvoNumber = string.Empty;

if (!string.IsNullOrWhiteSpace(message.Kbo))
if (!string.IsNullOrWhiteSpace(message.KboNumber))
{
CommandSender.Send(CreateOrganisationRequestMapping.MapToCreateKboOrganisation(message, User));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class CreateOrganisationRequest

public DateTime? ValidTo { get; set; }

public string Kbo { get; set; }
public string KboNumber { get; set; }

public List<BankAccount> BankAccounts { get; set; }

Expand Down Expand Up @@ -80,7 +80,7 @@ public CreateOrganisationRequestValidator()
RuleFor(x => x.Name)
.NotEmpty()
.WithMessage("Name is required.")
.When(x => string.IsNullOrEmpty(x.Kbo));
.When(x => string.IsNullOrEmpty(x.KboNumber));

RuleFor(x => x.Name)
.Length(0, OrganisationListConfiguration.NameLength)
Expand Down Expand Up @@ -209,7 +209,7 @@ public static CreateKboOrganisation MapToCreateKboOrganisation(
new ValidFrom(message.ValidFrom),
new ValidTo(message.ValidTo),
user,
new KboNumber(message.Kbo));
new KboNumber(message.KboNumber));
}
}
}

0 comments on commit 56a09a6

Please sign in to comment.