This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------WebKitFormBoundaryyhp46aRYDyMR9B4n | |
Content-Disposition: form-data; name="title" | |
Video Title | |
------WebKitFormBoundaryyhp46aRYDyMR9B4n | |
Content-Disposition: form-data; name="description" | |
Video Description | |
------WebKitFormBoundaryyhp46aRYDyMR9B4n | |
Content-Disposition: form-data; name="thumbnail" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const portfolio = await prisma.portfolio.findUnique({ where: { id: req.user.id } }) | |
const stocks = await prisma.portfolioStocks.findMany({ | |
where: { | |
owner: { | |
id: 1 | |
} | |
} | |
}) | |
let listOfStocks = stocks.map(x=>x.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Promise.all([ | |
prisma.portfolio.findUnique({where: { id: req.user.id }}), | |
prisma.portfolioStocks.findMany({where: { owner: { id: 1 }}}) | |
]).then(result => { | |
let [portfolio, stocks] = result | |
let listOfStocks = stocks.map(x=>x.name) | |
let list=[...new Set(listOfStocks)] // generating list of unique stock names to retrieve price from api | |
let dataPromises = list.map((stock)=>{ | |
return axios.get('https://data.messari.io/api/v1/assets/' + stock + '/metrics/market-data') |