Example #1
0
        public async Task <dynamic> DeleteImage(string imageId)
        {
            string userId = Request.Query
                            .SingleOrDefault(q => string.Compare(q.Key, "userId", StringComparison.OrdinalIgnoreCase) == 0)
                            .Value;

            if (string.IsNullOrEmpty(userId) || string.IsNullOrEmpty(imageId))
            {
                return(BadRequest("Missing parameters in request, userId/audioId"));
            }

            try
            {
                return(await _crudService.DeleteImageAsync(userId, imageId));
            }
            catch (Exception e)
            {
                _logger.LogError("Delete Image Failed " + e);
                return(BadRequest(e.Message));
            }
        }