8000 fix: create and read workspace page by presleyp · Pull Request #1294 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix: create and read workspace page #1294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 6, 2022
Prev Previous commit
Next Next commit
Add other api calls
  • Loading branch information
presleyp committed May 4, 2022
commit 74a5d1d1d85daf3df308134102246d47a5a27408
10 changes: 10 additions & 0 deletions site/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,21 @@ export const getUsers = async (): Promise<TypesGen.User[]> => {
return response.data
}

export const getOrganization = async (): Promise<Types.Organization> => {
const response = await axios.get<Types.Organization>(`/api/v2/organizations/organizationId`)
return response.data
}

export const getOrganizations = async (): Promise<Types.Organization[]> => {
const response = await axios.get<Types.Organization[]>("/api/v2/users/me/organizations")
return response.data
}

export const getTemplate = async (templateId: string): Promise<Types.Template> => {
const response = await axios.get<Types.Template>(`/api/v2/templates/${templateId}`)
return response.data
}

export const getWorkspace = async (workspaceId: string): Promise<Types.Workspace> => {
const response = await axios.get<Types.Workspace>(
`/api/v2/workspaces/${workspaceId}`,
Expand Down
0