diff --git a/router/giksa.js b/router/giksa.js index 87fcb2b..8d87595 100644 --- a/router/giksa.js +++ b/router/giksa.js @@ -67,7 +67,11 @@ router.get('/', (req, res) => { console.log(err) return res.status(404).json({ error: 'Incorrect column' }) } - const jsondata = JSON.parse(data) + let jsondata = JSON.parse(data) + jsondata.datekind = datekind + jsondata.daykind = daykind + + console.log(jsondata) if (daykind == 'week') { //주중일 경우 return res.json(jsondata.residence_week) } else { //주말일 경우 diff --git a/router/shuttlecock_i.js b/router/shuttlecock_i.js index b322a12..a02d94a 100644 --- a/router/shuttlecock_i.js +++ b/router/shuttlecock_i.js @@ -68,7 +68,9 @@ router.get('/', (req, res) => { console.log(err) return res.status(404).json({ error: 'Incorrect column' }) } - const jsondata = JSON.parse(data) + let jsondata = JSON.parse(data); + jsondata.datekind = datekind; + jsondata.daykind = daykind; if (daykind == 'week') { //주중일 경우 return res.json(jsondata.shuttlecock_i_week) } else { //주말일 경우 diff --git a/router/shuttlecock_o.js b/router/shuttlecock_o.js index c1c2962..a5f3919 100644 --- a/router/shuttlecock_o.js +++ b/router/shuttlecock_o.js @@ -67,7 +67,9 @@ router.get('/', (req, res) => { console.log(err) return res.status(404).json({ error: 'Incorrect column' }) } - const jsondata = JSON.parse(data) + let jsondata = JSON.parse(data); + jsondata.datekind = datekind; + jsondata.daykind = daykind; if (daykind == 'week') { //주중일 경우 return res.json(jsondata.shuttlecock_o_week) } else { //주말일 경우 diff --git a/router/subway.js b/router/subway.js index 0f861cb..f2bba83 100644 --- a/router/subway.js +++ b/router/subway.js @@ -68,7 +68,9 @@ router.get('/', (req, res) => { console.log(err) return res.status(404).json({ error: 'Incorrect column' }) } - const jsondata = JSON.parse(data) + let jsondata = JSON.parse(data); + jsondata.datekind = datekind; + jsondata.daykind = daykind; if(daykind == 'week'){ //주중일 경우 return res.json(jsondata.subway_week) } else { //주말일 경우 diff --git a/router/yesulin.js b/router/yesulin.js index 3914d43..6a04ea5 100644 --- a/router/yesulin.js +++ b/router/yesulin.js @@ -67,7 +67,10 @@ router.get('/', (req, res) => { console.log(err) return res.status(404).json({ error: 'Incorrect column' }) } - const jsondata = JSON.parse(data) + let jsondata = JSON.parse(data); + jsondata.datekind = datekind; + jsondata.daykind = daykind; + if (daykind == 'week') { //주중일 경우 return res.json(jsondata.yesulin_week) } else { //주말일 경우