Is there a smarter way to use optional query values
is there a cleaner way to not have to do things this way?
let newParentFolderId: string | undefined = getValue();
return db.query.imageFiles
.findFirst({
where: newParentFolderId ? eq(imageFiles.parentFolderId, newParentFolderId) : isNull(imageFiles.parentFolderId)
})
.execute();