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')
|
throw new Error('Invalid combination of filters')
|
||||||
|
|
||||||
return prisma.wifiDevice.findMany({
|
return prisma.wifiDevice.findMany({
|
||||||
orderBy: [{ lastSeen: 'desc' }],
|
orderBy: [{ lastSeen: 'desc' }, { hostname: 'asc' }],
|
||||||
where: identifiedOnly
|
where: identifiedOnly
|
||||||
? { NOT: { userId: null } }
|
? { NOT: { userId: null } }
|
||||||
: nonIdentifiedOnly
|
: nonIdentifiedOnly
|
||||||
|
|
Loading…
Reference in New Issue
Block a user