From bb894c04e079946b3e5c1c71bbbcd2f0d0a7490a Mon Sep 17 00:00:00 2001 From: Douglas Barone Date: Mon, 21 Dec 2020 10:24:25 -0400 Subject: [PATCH] Improve sorting --- server/src/resolvers/Query/wifiDevices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/resolvers/Query/wifiDevices.js b/server/src/resolvers/Query/wifiDevices.js index aef3f6c..3418565 100644 --- a/server/src/resolvers/Query/wifiDevices.js +++ b/server/src/resolvers/Query/wifiDevices.js @@ -5,7 +5,7 @@ export async function wifiDevices(_, { identifiedOnly, nonIdentifiedOnly }) { throw new Error('Invalid combination of filters') return prisma.wifiDevice.findMany({ - orderBy: [{ lastSeen: 'desc' }], + orderBy: [{ lastSeen: 'desc' }, { hostname: 'asc' }], where: identifiedOnly ? { NOT: { userId: null } } : nonIdentifiedOnly