updated as in the interactions api

This commit is contained in:
csawatzky 2025-04-21 16:40:30 -06:00
parent e8e32e1886
commit c617ebf868
12 changed files with 66 additions and 50 deletions

View file

@ -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);
});
}}