Improve sorting
This commit is contained in:
parent
5d462431d4
commit
bb894c04e0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user