arr1 = [{
id: 121212,
name: "name"
}, {
id: 121213,
name: "title"
}, {
id: 121214,
name: "adress"
}],
arr2 = [{
123456: "response",
123487: "response2",
121321: "response3"
}, {
122256: "response4",
123337: "response5",
124441: "response6"
}, {
166656: "response7",
12777: "response8",
1888321: "response9"
}]
result = [{
name: "response",
title: "response2",
adress: "response3"
},
{
name: "response4",
title: "response5",
adress: "response6"
},
{
name: "response7",
title: "response8",
adress: "response9"
}
]
Via Active questions tagged javascript - Stack Overflow https://ift.tt/HOGBID2
I am trying to pull some data from a Postgres database using Node.js and node-postures but I can't figure out why my service isn't connecting. my routes/index.js file: const express = require('express'); const router = express.Router(); const ordersCountController = require('../controllers/ordersCountController'); const ordersController = require('../controllers/ordersController'); const weeklyReportsController = require('../controllers/weeklyReportsController'); router.get('/orders_count', ordersCountController); router.get('/orders', ordersController); router.get('/weekly_reports', weeklyReportsController); module.exports = router; My controllers/weeklyReportsController.js file: const weeklyReportsService = require('../services/weeklyReportsService'); const weeklyReportsController = async (req, res) => { try { const data = await weeklyReportsService; res.json({data}) console...
Comments
Post a Comment