Beispiel #1
0
        public async Task <IActionResult> Create([FromBody] DiaryDTO diaryDto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var userId = _identityService.GetUserIdByNameAsync(User.Identity.Name).ToString();

            await _diaryService.CreateNewEntry(diaryDto, userId);

            _logger.LogInformation($"{userId} add new entry");

            return(Ok());
        }