列車ダイヤも移動
This commit is contained in:
parent
c25509c62f
commit
a87b29e961
@ -12,11 +12,10 @@ export const useAllTrainDiagram = () => {
|
|||||||
|
|
||||||
export const AllTrainDiagramProvider = ({ children }) => {
|
export const AllTrainDiagramProvider = ({ children }) => {
|
||||||
const [allTrainDiagram, setAllTrainDiagram] = useState();
|
const [allTrainDiagram, setAllTrainDiagram] = useState();
|
||||||
const customData = {
|
const customData = {};
|
||||||
};
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetch(
|
fetch(
|
||||||
"https://script.google.com/macros/s/AKfycbx_s7RB-xTy-iAslFJg7LfplLV09-hjDXEjdi9kCP_JT45wq17Af_IPOKIOqIfaNDg/exec"
|
"http://n8n.haruk.in/webhook/CrowdTh%E2%82%AC71m3Ra7!ngLead%E2%82%ACr$"
|
||||||
)
|
)
|
||||||
.then((res) => res.json())
|
.then((res) => res.json())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@ -30,6 +29,24 @@ export const AllTrainDiagramProvider = ({ children }) => {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
Object.assign(res, customData);
|
Object.assign(res, customData);
|
||||||
setAllTrainDiagram(res);
|
setAllTrainDiagram(res);
|
||||||
|
})
|
||||||
|
.catch((d) => {
|
||||||
|
fetch(
|
||||||
|
"https://script.google.com/macros/s/AKfycbx_s7RB-xTy-iAslFJg7LfplLV09-hjDXEjdi9kCP_JT45wq17Af_IPOKIOqIfaNDg/exec"
|
||||||
|
)
|
||||||
|
.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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user