Remove unecessary check

This commit is contained in:
Douglas Barone 2021-01-04 15:07:38 -04:00
parent ce1ce11877
commit d77f1a96b2

View File

@ -3,14 +3,12 @@ import prisma from '../../prisma'
const MAX_RESULT = 5000
export async function logs(parent, { search, dateIn, dateOut, limit }) {
if (!dateOut) dateOut = new Date()
try {
const logs = await prisma.log.findMany({
where: {
timestamp: {
gte: dateIn ? new Date(dateIn) : undefined,
lte: new Date(dateOut)
lte: dateOut ? new Date(dateOut) : undefined
}
},
orderBy: { timestamp: 'desc' },