Skip to content

Commit

Permalink
Update getPages fields and flatten output
Browse files Browse the repository at this point in the history
  • Loading branch information
azdak committed Oct 18, 2024
1 parent 1ae4d74 commit 61e9353
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/routes/getPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,27 @@ export const getPages = async ({ request, reply }) => {
}
`,
variables: {
limit: parseInt(request.query.limit ?? 100),
limit: parseInt(request.query.limit ?? 50),
offset: parseInt(request.query.offset ?? 0),
},
});

return {
status: 'success',
result: response,
result: response.map(
({
url,
id,
property:
{
id:property_id,
name:property_name
},
scans:
{
updated_at:last_scanned
}
})=>({ url, id, property_name, property_id, last_scanned })),
total: response?.count,
};
}

0 comments on commit 61e9353

Please sign in to comment.