( url: string, authToken: string, body: CreateProject )
| 37 | } |
| 38 | |
| 39 | export async function createProject( |
| 40 | url: string, |
| 41 | authToken: string, |
| 42 | body: CreateProject |
| 43 | ): Promise<CreateProjectResponse> { |
| 44 | try { |
| 45 | const res = await axios<CreateProjectResponse>({ |
| 46 | headers: { |
| 47 | Authorization: `Bearer ${authToken}`, |
| 48 | }, |
| 49 | method: 'post', |
| 50 | url: 'subqueries', |
| 51 | baseURL: url, |
| 52 | data: { |
| 53 | gitRepository: '', // Deprecated |
| 54 | ...body, |
| 55 | }, |
| 56 | }); |
| 57 | return res.data as unknown as CreateProjectResponse; |
| 58 | } catch (e) { |
| 59 | throw errorHandle(e, 'Failed to create project:'); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | export async function deleteProject( |
| 64 | authToken: string, |
no test coverage detected