Andrés Romaña
12/30/2021, 5:22 PMMaciek K
12/30/2021, 6:08 PMprisma.yourmodel.findMany({
where: {
startDate: { gte: "2019-12-01" },
endDate: { lte: "2019-12-05" ),
}
})
Is tht what you're looking for?Andrés Romaña
12/30/2021, 6:17 PMMaciek K
12/30/2021, 6:29 PMMaciek K
12/30/2021, 6:30 PMaxios.get('/apiEndpointWherePrismaCallIs', { params: {
startDate: startDate,
endDate: endDate
}
}) })
Maciek K
12/30/2021, 6:30 PMMaciek K
12/30/2021, 6:36 PMapp.get(`/postEndpoint`, async (req, res) => {
const { startDate, endDate } = req.body
const result = await prisma.yourmodel.findMany({
where: {
startDate: { gte: startDate },
endDate: { lte: endDate ),
}
})
res.json(result)
})
Is that what you mean?Maciek K
12/30/2021, 6:37 PMMaciek K
12/30/2021, 6:41 PMdate
in your url. You might want to correct thatAndrés Romaña
12/30/2021, 6:54 PM