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