feat(infisical-pg): fixed plan going undefined and resolved project missing on env delete

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:23 +05:30
parent 5fe8bdc00b
commit 92f7b45e01
7 changed files with 14 additions and 9 deletions
@@ -32,17 +32,17 @@ export const registerLicenseRouter = async (server: FastifyZodProvider) => {
schema: {
params: z.object({ organizationId: z.string().trim() }),
response: {
200: z.any()
200: z.object({ plan: z.any() })
}
},
onRequest: verifyAuth([AuthMode.JWT]),
handler: async (req) => {
const data = await server.services.license.getOrgPlan({
const plan = await server.services.license.getOrgPlan({
actorId: req.permission.id,
actor: req.permission.type,
orgId: req.params.organizationId
});
return data;
return { plan };
}
});