public async Task Handle(UpdateLike command) { var retrospective = await _store.GetById <Retrospective>(command.RetrospectiveId); retrospective.UpdateLikeItem(command.LikeId, command.Description, command.ParticipantId); await _store.Save(retrospective, retrospective.Version); }
public async Task <ActionResult <string> > Put([FromBody] UpdateLike jsonRequest) { var response = await _mediator.Send(jsonRequest); var json = JsonSerializer.Serialize(response); return(json); }
public async Task <IActionResult> UpdateLike(Guid retrospectiveId, Guid likeId, string participantId, [FromBody] string description) { var retro = await _aggRepo.GetById <Retrospective>(retrospectiveId); var cmd = new UpdateLike(retrospectiveId, likeId, description, participantId); await _cmdSender.Send(cmd); var response = RedirectToAction("Get", new { retrospectiveId = retrospectiveId }); return(response); }
public async Task <Dictionary <string, object> > Handle(UpdateLike request, CancellationToken cancellationToken) { var response = new Dictionary <string, object>(); var succes = true; var likes = await _mediator.Send(new GetLikesByIdPersonAndIdOwnerQuery(request.PersonId, request.PetOwnerId)); foreach (Like like in likes) { like.PetLike = request.PetLike; } try { LikeContext.SaveChanges(); } catch { succes = false; } response.Add("succes", succes); response.Add("likes", likes); return(response); }