public async Task <IActionResult> DeleteMoodRecord(string moodRecordId, CancellationToken token) { _logger.LogTrace($"{nameof(DeleteMoodRecord)} moodRecordId: {moodRecordId}"); await _mediator.Send(MediatorRequestFactory.DeleteMoodRecordCommand(moodRecordId), token); return(NoContent()); }
public async Task <IActionResult> DeleteAllMoodRecords(CancellationToken token) { _logger.LogTrace($"{nameof(DeleteAllMoodRecords)}"); await _mediator.Send(MediatorRequestFactory.DeleteAllMoodRecordsCommand(), token); return(NoContent()); }
public async Task <IActionResult> UpdateMoodRecord( [FromBody] UpdateMoodRecordRequest request, CancellationToken token) { _logger.LogTrace($"{nameof(UpdateMoodRecord)} request body: {request}"); var result = await _mediator.Send(MediatorRequestFactory.UpdateMoodRecordCommand(request), token); return(Ok(result)); }
public async Task <IActionResult> GetLatestCreatedMoodRecords(int numberOfMoodRecords, CancellationToken token) { _logger.LogTrace( $"{nameof(GetLatestCreatedMoodRecords)} numberOfMoodRecords: {numberOfMoodRecords.ToString()}"); var result = await _mediator.Send( MediatorRequestFactory.GetLatestCreatedMoodRecordsQuery(numberOfMoodRecords), token); return(Ok(result)); }
public async Task <IActionResult> GetMoodRecordsByMoodRecordId( [FromBody] GetMoodRecordByMoodRecordIdRequest request, CancellationToken token) { _logger.LogTrace( $"{nameof(GetMoodRecordsByMoodRecordId)} request body: {JsonSerializer.Serialize(request)}"); var result = await _mediator.Send( MediatorRequestFactory.GetMoodRecordByMoodRecordIdQuery(request), token); return(Ok(result)); }