列車ダイヤも移動

This commit is contained in:
harukin-expo-dev-env 2024-03-27 14:35:49 +00:00
parent c25509c62f
commit a87b29e961

View File

@ -12,9 +12,25 @@ export const useAllTrainDiagram = () => {
export const AllTrainDiagramProvider = ({ children }) => {
const [allTrainDiagram, setAllTrainDiagram] = useState();
const customData = {
};
const customData = {};
useEffect(() => {
fetch(
"http://n8n.haruk.in/webhook/CrowdTh%E2%82%AC71m3Ra7!ngLead%E2%82%ACr$"
)
.then((res) => res.json())
.then((res) => {
const data = {};
res.forEach((d) => {
const keys = Object.keys(d);
data[keys] = d[keys];
});
return data;
})
.then((res) => {
Object.assign(res, customData);
setAllTrainDiagram(res);
})
.catch((d) => {
fetch(
"https://script.google.com/macros/s/AKfycbx_s7RB-xTy-iAslFJg7LfplLV09-hjDXEjdi9kCP_JT45wq17Af_IPOKIOqIfaNDg/exec"
)
@ -31,6 +47,7 @@ export const AllTrainDiagramProvider = ({ children }) => {
Object.assign(res, customData);
setAllTrainDiagram(res);
});
});
}, []);
return (