Skip to content

Commit

Permalink
Cleaned up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-oconnell committed Sep 26, 2024
1 parent 603c38d commit f060526
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions thoth-api/src/graphql/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1970,10 +1970,7 @@ impl MutationRoot {
#[graphql(description = "Values to apply to existing location")] data: PatchLocation,
) -> FieldResult<Location> {
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)?)?;
Expand All @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions thoth-app/src/component/locations_form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit f060526

Please sign in to comment.