Spaces:
Runtime error
Runtime error
File size: 629 Bytes
cd6f98e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | import { z } from "zod";
import { get } from "../fetch-utils";
const OrganizationUsersSchema = z.object({
id: z.string(),
name: z.string(),
users: z.array(
z.object({
id: z.string(),
role: z.string(),
user: z.object({
id: z.string(),
name: z.string(),
email: z.string(),
}),
})
),
});
export class OrganizationApi {
readonly accessToken?: string;
constructor(accessToken?: string) {
this.accessToken = accessToken;
}
async get(name: string) {
return await get(`/api/auth/organization/${name}`, OrganizationUsersSchema, this.accessToken);
}
}
|