diff --git a/thoth-api/src/graphql/model.rs b/thoth-api/src/graphql/model.rs index a162205d1..830cb9051 100644 --- a/thoth-api/src/graphql/model.rs +++ b/thoth-api/src/graphql/model.rs @@ -1970,10 +1970,7 @@ impl MutationRoot { #[graphql(description = "Values to apply to existing location")] data: PatchLocation, ) -> FieldResult { context.token.jwt.as_ref().ok_or(ThothError::Unauthorised)?; - let location = Location::from_id(&context.db, &data.location_id).unwrap(); - let account_id = context.token.jwt.as_ref().unwrap().account_id(&context.db); - context .account_access .can_edit(location.publisher_id(&context.db)?)?; @@ -1990,6 +1987,8 @@ impl MutationRoot { if data.canonical { data.canonical_record_complete(&context.db)?; } + + let account_id = context.token.jwt.as_ref().unwrap().account_id(&context.db); location .update(&context.db, &data, &account_id) .map_err(|e| e.into()) diff --git a/thoth-app/src/component/locations_form.rs b/thoth-app/src/component/locations_form.rs index 41cfabe6d..4515f9387 100644 --- a/thoth-app/src/component/locations_form.rs +++ b/thoth-app/src/component/locations_form.rs @@ -224,8 +224,8 @@ impl Component for LocationsFormComponent { ctx.props().update_locations.emit(()); ctx.link() .send_message(Msg::ToggleModalFormDisplay(false, None)); - // changed to false, but this doesn't change the display - // issue where the page jumps during refresh when modal is exited in the view + // changed the return value to false below, but this doesn't fix the display + // issue where the page jumps during refresh when modal is exited false } None => {