Merge two response data in one - NodeJS

0 votes

I want to merge the output from two different API calls into a single JSON answer using a NodeJS server that receives data from two different APIs. I'll send you the code right here:

EventModal.eventSearch(eventReq, type, async function (eventRes) {
       EventModal.getBoostEvents(eventReq, type, async function (eventBoostRes) {
                           res.json({
                                status: true,
                                data: eventRes,
                                eventBoostRes: eventBoostRes,
                            });
        });
  });

I want eventRes and eventBoostRes in one response in data.So how can I achieve that ?

eventRes and eventBoostRes are query result.

Thanks in advance.

Aug 11, 2022 in Node-js by Neha
• 9,020 points

edited 5 days ago 13 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP