Ejemplo n.º 1
0
        public async Task <IActionResult> RemovePermission([FromBody] ChangePermissionModel model)
        {
            #region Validation

            if (!ModelState.IsValid)
            {
                return(BadRequest(ErrorResponse.Create(ModelState)));
            }

            #endregion

            try
            {
                var isRemoved = await _service.RemovePermissionAsync(model.FileId, model.EmailAddress);

                return(Ok(isRemoved));
            }
            catch (Exception ex)
            {
                await _log.WriteErrorAsync("GoogleDriveController", nameof(RemovePermission), string.Empty, ex);

                return(StatusCode(500, ErrorResponse.Create(ex.Message)));
            }
        }