MCPcopy Create free account
hub / github.com/CodebuffAI/codebuff / fetchOrganizationBySlug

Function fetchOrganizationBySlug

web/src/hooks/use-organization-data.ts:27–38  ·  view source on GitHub ↗
(
  slug: string,
)

Source from the content-addressed store, hash-verified

25
26// Query functions
27const fetchOrganizationBySlug = async (
28 slug: string,
29): Promise<OrganizationDetails> => {
30 const response = await fetch(`/api/orgs/slug/${slug}`)
31
32 if (!response.ok) {
33 const error = await response.json()
34 throw new Error(error.error || 'Failed to fetch organization')
35 }
36
37 return response.json()
38}
39
40const fetchBillingStatus = async (orgId: string): Promise<BillingStatus> => {
41 const response = await fetch(`/api/orgs/${orgId}/billing/setup`)

Callers 1

useOrganizationDataFunction · 0.85

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected