feat: add organization settings and invitations
This commit is contained in:
@@ -31,14 +31,24 @@ export async function GET(): Promise<Response> {
|
||||
const rows = await database.select().from(organizations).where(eq(organizations.status, "active"));
|
||||
|
||||
return jsonSuccess("机构列表已加载", {
|
||||
organizations: rows.map((organization) => ({
|
||||
id: organization.id,
|
||||
name: organization.name,
|
||||
slug: organization.slug,
|
||||
status: organization.status,
|
||||
createdAt: organization.createdAt.toISOString(),
|
||||
updatedAt: organization.updatedAt.toISOString(),
|
||||
})),
|
||||
organizations: rows
|
||||
.filter((organization) => organization.registrationEnabled)
|
||||
.map((organization) => ({
|
||||
id: organization.id,
|
||||
name: organization.name,
|
||||
slug: organization.slug,
|
||||
status: organization.status,
|
||||
registrationEnabled: organization.registrationEnabled,
|
||||
oidcEnabled: organization.oidcEnabled,
|
||||
oidcIssuerUrl: "",
|
||||
oidcClientId: "",
|
||||
oidcHasClientSecret: organization.oidcClientSecret.length > 0,
|
||||
oidcScopes: organization.oidcScopes,
|
||||
oidcRedirectUri: organization.oidcRedirectUri,
|
||||
oidcAutoProvision: organization.oidcAutoProvision,
|
||||
createdAt: organization.createdAt.toISOString(),
|
||||
updatedAt: organization.updatedAt.toISOString(),
|
||||
})),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user