Exemple #1
0
        public async Task <IActionResult> SendCandidatureAsync(SendCandidatureRequest request)
        {
            var userId = HttpContext.GetUserId();

            var result = await _candidatureService.SendCandidatureAsync(userId, request.ClanId.ParseEntityId <ClanId>());

            if (result.IsValid)
            {
                return(this.Ok("The candidature as been sent."));
            }

            result.AddToModelState(ModelState);

            return(this.BadRequest(new ValidationProblemDetails(ModelState)));
        }
Exemple #2
0
 private async Task <HttpResponseMessage> ExecuteAsync(SendCandidatureRequest candidaturePostRequest)
 {
     return(await _httpClient.PostAsJsonAsync("api/candidatures", candidaturePostRequest));
 }