Bugfix
This commit is contained in:
parent
619f9661a0
commit
ce91516b23
|
@ -35,9 +35,7 @@ export async function wifiUsers(parent, { take = 100, skip = 0, search }) {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
include: {
|
include: {
|
||||||
wifiDevices: {
|
wifiDevices: true
|
||||||
include: { accessPoint: true }
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
orderBy: [
|
orderBy: [
|
||||||
{ wifiDevices: { _count: 'desc' } },
|
{ wifiDevices: { _count: 'desc' } },
|
||||||
|
|
|
@ -17,7 +17,21 @@ const WifiDevice = {
|
||||||
|
|
||||||
accessPoint: async parent => {
|
accessPoint: async parent => {
|
||||||
|
|
||||||
return prisma.accessPoint.findUnique({ where: { id: parent.accessPointId } })
|
try {
|
||||||
|
const ap = await prisma.accessPoint.findUnique({ where: { hostname: parent.apName } })
|
||||||
|
if (ap)
|
||||||
|
return ap
|
||||||
|
else
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
logError({
|
||||||
|
tags: ['wifiDevice', 'accessPoint'],
|
||||||
|
message: `Could not find access point ${parent.apName}`,
|
||||||
|
data: parent
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user