Exemple #1
0
        public IActionResult UpdateStorageSiteMasterData(Guid id, [FromBody] StorageSiteMasterDataUpdateRequest storageSiteMasterDataUpdateRequest)
        {
            if (id == null || storageSiteMasterDataUpdateRequest == null ||
                string.IsNullOrWhiteSpace(storageSiteMasterDataUpdateRequest.Name))
            {
                return(HandleBadRequest("A valid storage site ID and name have to be supplied."));
            }

            try
            {
                StorageSite site = LocationsService.UpdateStorageSiteMasterData(id, storageSiteMasterDataUpdateRequest.Name);
                return(Ok(site));
            }
            catch (StorageSiteNotFoundException exception)
            {
                return(HandleResourceNotFoundException(exception));
            }
            catch (Exception exception)
            {
                return(HandleUnexpectedException(exception));
            }
        }