Remove unecessary check
This commit is contained in:
parent
ce1ce11877
commit
d77f1a96b2
|
@ -3,14 +3,12 @@ import prisma from '../../prisma'
|
||||||
const MAX_RESULT = 5000
|
const MAX_RESULT = 5000
|
||||||
|
|
||||||
export async function logs(parent, { search, dateIn, dateOut, limit }) {
|
export async function logs(parent, { search, dateIn, dateOut, limit }) {
|
||||||
if (!dateOut) dateOut = new Date()
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const logs = await prisma.log.findMany({
|
const logs = await prisma.log.findMany({
|
||||||
where: {
|
where: {
|
||||||
timestamp: {
|
timestamp: {
|
||||||
gte: dateIn ? new Date(dateIn) : undefined,
|
gte: dateIn ? new Date(dateIn) : undefined,
|
||||||
lte: new Date(dateOut)
|
lte: dateOut ? new Date(dateOut) : undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
orderBy: { timestamp: 'desc' },
|
orderBy: { timestamp: 'desc' },
|
||||||
|
|
Loading…
Reference in New Issue
Block a user