api処理パス設定ミスを修正
This commit is contained in:
parent
05167c810a
commit
85e2ad329d
@ -18,7 +18,9 @@ export const AllTrainDiagramProvider = ({ children }) => {
|
|||||||
"http://n8n.haruk.in/webhook/CrowdTh%E2%82%AC71m3Ra7!ngLead%E2%82%ACr$"
|
"http://n8n.haruk.in/webhook/CrowdTh%E2%82%AC71m3Ra7!ngLead%E2%82%ACr$"
|
||||||
)
|
)
|
||||||
.then((res) => res.json())
|
.then((res) => res.json())
|
||||||
|
.then((res) => res.data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
const data = {};
|
const data = {};
|
||||||
res.forEach((d) => {
|
res.forEach((d) => {
|
||||||
const keys = Object.keys(d);
|
const keys = Object.keys(d);
|
||||||
@ -31,6 +33,7 @@ export const AllTrainDiagramProvider = ({ children }) => {
|
|||||||
setAllTrainDiagram(res);
|
setAllTrainDiagram(res);
|
||||||
})
|
})
|
||||||
.catch((d) => {
|
.catch((d) => {
|
||||||
|
alert("error");
|
||||||
fetch(
|
fetch(
|
||||||
"https://script.google.com/macros/s/AKfycbx_s7RB-xTy-iAslFJg7LfplLV09-hjDXEjdi9kCP_JT45wq17Af_IPOKIOqIfaNDg/exec"
|
"https://script.google.com/macros/s/AKfycbx_s7RB-xTy-iAslFJg7LfplLV09-hjDXEjdi9kCP_JT45wq17Af_IPOKIOqIfaNDg/exec"
|
||||||
)
|
)
|
||||||
|
@ -29,6 +29,7 @@ export const CurrentTrainProvider = ({ children }) => {
|
|||||||
const getCurrentTrain = () => {
|
const getCurrentTrain = () => {
|
||||||
fetch("https://n8n.haruk.in/webhook/c501550c-7d1b-4e50-927b-4429fe18931a")
|
fetch("https://n8n.haruk.in/webhook/c501550c-7d1b-4e50-927b-4429fe18931a")
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
|
.then((d) => d.data)
|
||||||
.then((d) =>
|
.then((d) =>
|
||||||
d.map((x) => ({ num: x.TrainNum, delay: x.delay, Pos: x.Pos }))
|
d.map((x) => ({ num: x.TrainNum, delay: x.delay, Pos: x.Pos }))
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user