no need for 4k queries on each load now that data is stored on node itself

This commit is contained in:
liamcottle
2024-03-23 23:24:56 +13:00
parent d7252c9962
commit 3abdabdd09

View File

@ -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',
},
}),
}) })
} }