chore: align infrastructure with server
This commit is contained in:
@@ -31,11 +31,16 @@ export default defineEventHandler(async (event) => {
|
||||
orderBy: { updatedAt: 'desc' }
|
||||
})
|
||||
|
||||
const totalCount = await prisma.canvas.count()
|
||||
|
||||
const canvases = canvasList.map(c => ({
|
||||
...c,
|
||||
nodeCount: Array.isArray(c.nodes) ? (c.nodes as any[]).length : 0,
|
||||
nodes: undefined
|
||||
}))
|
||||
|
||||
return {
|
||||
canvases: canvasList.map(c => ({
|
||||
...c,
|
||||
nodeCount: Array.isArray(c.nodes) ? (c.nodes as any[]).length : 0,
|
||||
nodes: undefined
|
||||
}))
|
||||
canvases,
|
||||
totalCount
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user