This is what i want to do, the 3rd line in the pseudo code gets response from the request. Then i want to update the original request with the response data like the 4th line, is there any way i can do it ?
await Promise.resolve(buildReq(input))
.then((req) => httpPost(req))
.then((res) => res.data)
.then((req, resData) => _.update(req, 'field1', ()=>resData));
Here resData is from line 3, req is from line 1.