feat: adds pagination in organizations table

This commit is contained in:
Piyush Gupta
2025-10-07 22:59:48 +05:30
parent 464a18ccb2
commit b7b5939c16
7 changed files with 198 additions and 126 deletions
+11 -2
View File
@@ -230,7 +230,10 @@ export const registerAdminRouter = async (server: FastifyZodProvider) => {
createdAt: z.date()
})
.array()
}).array()
}).array(),
meta: z.object({
total: z.number()
})
})
}
},
@@ -243,9 +246,15 @@ export const registerAdminRouter = async (server: FastifyZodProvider) => {
const organizations = await server.services.superAdmin.getOrganizations({
...req.query
});
const count = await server.services.superAdmin.countOrganizations({
...req.query
});
return {
organizations
organizations,
meta: {
total: count
}
};
}
});