no need for 4k queries on each load now that data is stored on node itself
This commit is contained in:
@ -61,14 +61,7 @@ app.get('/api/v1/nodes', async (req, res) => {
|
|||||||
node_id_hex: "!" + node.node_id.toString(16),
|
node_id_hex: "!" + node.node_id.toString(16),
|
||||||
hardware_model_name: HardwareModel.valuesById[node.hardware_model] ?? "UNKNOWN",
|
hardware_model_name: HardwareModel.valuesById[node.hardware_model] ?? "UNKNOWN",
|
||||||
role_name: Role.valuesById[node.role] ?? "UNKNOWN",
|
role_name: Role.valuesById[node.role] ?? "UNKNOWN",
|
||||||
neighbour_info: await prisma.neighbourInfo.findFirst({
|
neighbour_info: node.neighbours, // todo: remove once ui uses new neighbours key
|
||||||
where: {
|
|
||||||
node_id: node.node_id,
|
|
||||||
},
|
|
||||||
orderBy: {
|
|
||||||
id: 'desc',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user