Example #1
0
        public async Task <BaseResponse <string> > DeleteAlbumPhotos(DeleteAlbumPhotosModel deleteAlbumPhotosModel)
        {
            BaseResponse <string> baseResponse = new BaseResponse <string>();

            foreach (var item in deleteAlbumPhotosModel.images)
            {
                var filesDto = _mapper.Map <FilesDto>(item);
                await _filesService.Delete(filesDto);
            }
            baseResponse.Result = "Success Delete";
            return(baseResponse);
        }
Example #2
0
        public async Task <IActionResult> deleteAlbumPhotos(DeleteAlbumPhotosModel deleteAlbumPhotosModel)
        {
            try
            {
                _logger.LogInfo(ControllerContext.ActionDescriptor.DisplayName);
                if (ModelState.IsValid)
                {
                    var result = await _albumService.DeleteAlbumPhotos(deleteAlbumPhotosModel);

                    //await _musicTypesHub.Clients.All.SendAsync("newMusicTypeAdded",newMusicTypes);
                    InfoLog($"{ControllerContext.ActionDescriptor.DisplayName} Album Deleted Photos : {deleteAlbumPhotosModel.images}");
                    return(Ok(result));
                }
                return(BadRequest());
            }
            catch (Exception exception)
            {
                return(ErrorInternal(exception, $"{ControllerContext.ActionDescriptor.DisplayName} Exception Message : {exception.Message} - {exception.InnerException}"));
            }
        }