示例#1
0
        public async Task <object> DeleteAsync(
            [FromBody] WriteNewsItemRequest body)
        {
            if (body.Id == null)
            {
                return(BadRequest(JResponse.Error("News item id not specified.")));
            }

            _logger.LogInformation($"Deleting news item: {body.Id} (deleted by {User.Identity.Name}");
            await _newsItemRepository.DeleteAsync(body.Id);

            return(JResponse.OK());
        }