Fixed wifiDevices query
This commit is contained in:
parent
1a69ad12e0
commit
f470be38cb
|
@ -98,9 +98,10 @@ const Query = {
|
|||
// console.log('PubSub') //TODO: PubSub
|
||||
// })
|
||||
|
||||
return prisma.wifiDevices({
|
||||
return prisma.wifiDevice.findMany({
|
||||
orderBy: [{ lastSeen: 'desc' }],
|
||||
where: identifiedOnly ? { NOT: { user: null } } : {}
|
||||
where: identifiedOnly ? { NOT: { userId: null } } : {},
|
||||
include: { user: true }
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import prisma from '../prisma'
|
||||
|
||||
const WifiDevice = {
|
||||
user: _ => prisma.wifiDevice.findOne({ where: { id: _.id } }).User(),
|
||||
lastSeen: _ => _.lastSeen.toISOString(),
|
||||
firstSeen: _ => _.firstSeen.toISOString()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user