Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HidyHan committed Apr 23, 2024
1 parent 71e03fd commit 77001f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react';
import { JsonApiDataStore } from 'jsonapi-datastore';
import { findDOMNode } from 'react-dom';
import useSWR from 'swr';
import { apiWrapper, fetchFileSummary } from '../../../util/apiWrapper';
import { apiWrapper, fetchBundleStores, fetchFileSummary } from '../../../util/apiWrapper';

import ConfigPanel from '../ConfigPanel';
import ErrorMessage from '../ErrorMessage';
Expand Down Expand Up @@ -111,6 +111,13 @@ const BundleDetail = ({
bundleInfo.metadataTypes = response.data.meta.metadata_type;
setBundleInfo(bundleInfo);
setMetadataErrors([]);

fetchBundleStores(uuid)
.then((response) => {
const bundleStore = response.data[0].attributes.name;
bundleInfo.bundleStore = bundleStore;
setBundleInfo(bundleInfo);
});
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ class BundleDetailSideBar extends React.Component {
const showDependencies = !!bundle.dependencies?.value?.length;
const showHostWorksheets = !!bundle.host_worksheets?.value.length;

let bundleStoreResponse = await fetchBundleStores(uuid);
const bundleStore = bundleStoreResponse.data[0].attributes.name;

return (
<div className={classes.sidebar}>
{showPageLink && (
Expand Down Expand Up @@ -113,8 +110,8 @@ class BundleDetailSideBar extends React.Component {
{(showRunFields || showDatasetFields) && (
<BundleFieldRow
label='Store'
field={bundleStore}
onChange={(store) => onUpdate({ store })}
field={bundle.bundleStore}
onChange={(bundleStore) => onUpdate({ bundleStore })}
/>
)}
</BundleFieldTable>
Expand Down

0 comments on commit 77001f9

Please sign in to comment.