fix: return null on no orgId

This commit is contained in:
Bereket Engida
2024-10-09 13:10:20 +03:00
parent 95f68f7ec6
commit 6862e1f433

View File

@@ -228,8 +228,8 @@ export const getFullOrganization = createAuthEndpoint(
const session = ctx.context.session;
const orgId = ctx.query.orgId || session.session.activeOrganizationId;
if (!orgId) {
throw new APIError("BAD_REQUEST", {
message: "Organization not found",
return ctx.json(null, {
status: 400,
});
}
const adapter = getOrgAdapter(ctx.context.adapter, ctx.context.orgOptions);