The goal is to receive data from two endpoints real time/interval: fetch("/api/cards") and fetch("/api/agvs").
/api/cards will return something like: [ { "segmentId": "Caminho-24", "cardValue": "043389C25E7180", "created_at": "2023-12-05T02:47:18.317Z" }, { "segmentId": "Caminho-25", "cardValue": "044FA6C25E7180", "created_at": "2023-12-05T03:09:35.990Z" } ]
and /api/agvs should return something like: [{"IP":"192.168.15.15","CURRENT":"ffffffff","LAST":"ffffffff"},{"IP":"192.168.15.21","CURRENT":"044FA6C25E7180","LAST":"043389C25E7180"},{"IP":"192.168.15.4","CURRENT":"ffffffff","LAST":"ffffffff"}]
I want to check if any object of agvs list has the Current card === any of the cards, if so, the segmentId should change stroke from "black" to "red"