chore: complete clean Agent Desk source snapshot
This commit is contained in:
31
web/lib/api/organization.ts
Normal file
31
web/lib/api/organization.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { request } from "@/lib/api/client"
|
||||
|
||||
export type OrganizationItem = {
|
||||
id: number
|
||||
code: string
|
||||
name: string
|
||||
logo: string
|
||||
plan: string
|
||||
status: number
|
||||
role?: string
|
||||
isActive: boolean
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export type UserOrganizationListResponse = {
|
||||
currentOrganizationId: number
|
||||
organizations: OrganizationItem[]
|
||||
}
|
||||
|
||||
export async function listMyOrganizations() {
|
||||
return request<UserOrganizationListResponse>("/api/dashboard/organization/my_list", {
|
||||
method: "GET",
|
||||
})
|
||||
}
|
||||
|
||||
export async function switchOrganization(organizationId: number) {
|
||||
return request<OrganizationItem>("/api/dashboard/organization/switch", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ organizationId }),
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user