Skip to content

Instantly share code, notes, and snippets.

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')
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)
@slebetman
slebetman / req.body.txt
Created June 17, 2022 03:52
Decoded buffer
------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"