From 52d561f396c4cb93b9ea809f3fba288cfe270a19 Mon Sep 17 00:00:00 2001 From: Douglas Barone Date: Tue, 1 Dec 2020 15:19:03 -0400 Subject: [PATCH] Minimal refactoring --- server/src/resolvers/Query.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/resolvers/Query.js b/server/src/resolvers/Query.js index dd0f69e..c545ea2 100755 --- a/server/src/resolvers/Query.js +++ b/server/src/resolvers/Query.js @@ -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()