modified th api's for bin, contract and task to have as passed in as a prop and not get it ffrom the global state directly in the api
This commit is contained in:
parent
4bcac4e346
commit
e2f5eb0557
31 changed files with 155 additions and 507 deletions
|
|
@ -168,7 +168,7 @@ export default function Bin(props: Props) {
|
|||
// const binID = binKey ?? match.params.binID;
|
||||
const binID = binKey ?? useParams<{ binID: string }>()?.binID ?? "";
|
||||
const binAPI = useBinAPI();
|
||||
const [{ user }] = useGlobalState();
|
||||
const [{ user, as }] = useGlobalState();
|
||||
const [binLoading, setBinLoading] = useState(false);
|
||||
const loadRef = useRef<boolean>(false);
|
||||
const [bin, setBin] = useState<IBin>(IBin.create());
|
||||
|
|
@ -269,7 +269,7 @@ export default function Bin(props: Props) {
|
|||
loadRef.current = true;
|
||||
//add the presets to the bin page data load
|
||||
binAPI
|
||||
.getBinPageData(binID, user.id(), showErrors)
|
||||
.getBinPageData(binID, user.id(), showErrors, as)
|
||||
.then(resp => {
|
||||
if (resp.data.grainCompositionNames) {
|
||||
let tempMap: Map<string, string> = new Map();
|
||||
|
|
@ -347,7 +347,7 @@ export default function Bin(props: Props) {
|
|||
loadRef.current = false;
|
||||
});
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [binID, user.id(), binAPI, showErrors]);
|
||||
}, [binID, user.id(), binAPI, showErrors, as]);
|
||||
|
||||
useEffect(() => {
|
||||
load();
|
||||
|
|
@ -788,7 +788,7 @@ export default function Bin(props: Props) {
|
|||
}
|
||||
});
|
||||
//update the bins status with the new values based on the components changed
|
||||
binAPI.updateBinStatus(bin.key(), bin.status);
|
||||
binAPI.updateBinStatus(bin.key(), bin.status, as);
|
||||
};
|
||||
|
||||
const binComponents = (preferences: Map<string, pond.BinComponentPreferences>) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue