(queryParams: ListReposQueryParams)
| 69 | } |
| 70 | |
| 71 | export const listRepos = async (queryParams: ListReposQueryParams): Promise<ListReposResponse | ServiceError> => { |
| 72 | const url = new URL("/api/repos", window.location.origin); |
| 73 | for (const [key, value] of Object.entries(queryParams)) { |
| 74 | url.searchParams.set(key, value.toString()); |
| 75 | } |
| 76 | |
| 77 | const result = await fetch(url, { |
| 78 | method: "GET", |
| 79 | headers: { |
| 80 | "Content-Type": "application/json", |
| 81 | "X-Sourcebot-Client-Source": "sourcebot-web-client", |
| 82 | }, |
| 83 | }).then(response => response.json()); |
| 84 | |
| 85 | return result as ListReposResponse | ServiceError; |
| 86 | } |
| 87 | |
| 88 | export const getVersion = async (): Promise<GetVersionResponse> => { |
| 89 | const result = await fetch("/api/version", { |
no outgoing calls
no test coverage detected