updated as in the interactions api
This commit is contained in:
parent
e8e32e1886
commit
c617ebf868
12 changed files with 66 additions and 50 deletions
|
|
@ -94,7 +94,7 @@ export default function BinConditioningInteraction(props: Props) {
|
|||
const [sliderMarks, setSliderMarks] = useState<Map<quack.MeasurementType, number>>(new Map());
|
||||
//this is the emc value calculated from the interactions temp and humidity conditions
|
||||
const [baseEMC, setBaseEMC] = useState<number | undefined>();
|
||||
const [{ user }] = useGlobalState();
|
||||
const [{ user, as }] = useGlobalState();
|
||||
const classes = useStyles();
|
||||
const interactionAPI = useInteractionsAPI();
|
||||
const { openSnack } = useSnackbar();
|
||||
|
|
@ -144,7 +144,7 @@ export default function BinConditioningInteraction(props: Props) {
|
|||
|
||||
const updateInteraction = () => {
|
||||
interactionAPI
|
||||
.updateInteraction(deviceId, interaction.settings)
|
||||
.updateInteraction(deviceId, interaction.settings, as)
|
||||
.then(resp => {
|
||||
openSnack("Updated Interaction Conditions");
|
||||
})
|
||||
|
|
|
|||
|
|
@ -108,10 +108,10 @@ export default function GrainNodeInteractions(props: Props) {
|
|||
}, [selectedNode]);
|
||||
|
||||
useEffect(() => {
|
||||
interactionAPI.listInteractionsByComponent(device.id(), cable.location()).then(resp => {
|
||||
interactionAPI.listInteractionsByComponent(device.id(), cable.location(), undefined, as).then(resp => {
|
||||
setCableInteractions(resp);
|
||||
});
|
||||
}, [cable, device, interactionAPI]);
|
||||
}, [cable, device, interactionAPI, as]);
|
||||
|
||||
useEffect(() => {
|
||||
//do the reversing to make the selected node match the array in the
|
||||
|
|
@ -163,7 +163,7 @@ export default function GrainNodeInteractions(props: Props) {
|
|||
//TODO-CS: make function to update multiple interactions at once to avoid this loop if it becomes a problem
|
||||
cableInteractions.forEach(interaction => {
|
||||
interactionAPI
|
||||
.updateInteraction(device.id(), interaction.settings)
|
||||
.updateInteraction(device.id(), interaction.settings, as)
|
||||
.then(resp => {})
|
||||
.catch(err => {});
|
||||
});
|
||||
|
|
@ -359,7 +359,7 @@ export default function GrainNodeInteractions(props: Props) {
|
|||
permissions={permissions}
|
||||
refreshCallback={() => {
|
||||
interactionAPI
|
||||
.listInteractionsByComponent(device.id(), cable.location())
|
||||
.listInteractionsByComponent(device.id(), cable.location(), undefined, as)
|
||||
.then(resp => {
|
||||
setCableInteractions(resp);
|
||||
});
|
||||
|
|
@ -440,7 +440,7 @@ export default function GrainNodeInteractions(props: Props) {
|
|||
setNewInteraction(false);
|
||||
}}
|
||||
refreshCallback={() => {
|
||||
interactionAPI.listInteractionsByComponent(device.id(), cable.location()).then(resp => {
|
||||
interactionAPI.listInteractionsByComponent(device.id(), cable.location(), undefined, as).then(resp => {
|
||||
setCableInteractions(resp);
|
||||
});
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue