From f06052634ef46a83083417e42e60886738fffed3 Mon Sep 17 00:00:00 2001 From: Brendan O'Connell Date: Thu, 26 Sep 2024 09:42:40 +0200 Subject: [PATCH] Cleaned up comments --- thoth-api/src/graphql/model.rs | 5 ++--- thoth-app/src/component/locations_form.rs | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/thoth-api/src/graphql/model.rs b/thoth-api/src/graphql/model.rs index a162205d..830cb905 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 41cfabe6..4515f938 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 => {