Minimal refactoring
This commit is contained in:
parent
04a2fb01cb
commit
52d561f396
|
@ -90,7 +90,7 @@ const Query = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
wifiDevices: async (_, { identifiedOnly, nonIdentifiedOnly }) => {
|
async wifiDevices(_, { identifiedOnly, nonIdentifiedOnly }) {
|
||||||
if (identifiedOnly && nonIdentifiedOnly)
|
if (identifiedOnly && nonIdentifiedOnly)
|
||||||
throw new Error('Invalid combination of filters')
|
throw new Error('Invalid combination of filters')
|
||||||
|
|
||||||
|
@ -107,14 +107,14 @@ const Query = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
wifiUsers: () => {
|
async wifiUsers() {
|
||||||
return prisma.user.findMany({
|
return prisma.user.findMany({
|
||||||
where: { wifiDevices: { some: { NOT: { lastSeen: null } } } },
|
where: { wifiDevices: { some: { id: { not: undefined } } } },
|
||||||
include: { wifiDevices: true }
|
include: { wifiDevices: true }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
userPresence: async (_, { search }) => {
|
async userPresence(_, { search }) {
|
||||||
if (!search) search = ''
|
if (!search) search = ''
|
||||||
|
|
||||||
updateDBWithOnlineDevices()
|
updateDBWithOnlineDevices()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user