( apiPath: string, resource: Partial<T>, )
| 75 | |
| 76 | /** Create a resource. */ |
| 77 | export async function k8sCreate<T extends K8sResource>( |
| 78 | apiPath: string, |
| 79 | resource: Partial<T>, |
| 80 | ): Promise<T> { |
| 81 | const res = await fetch(`${apiBase()}${apiPath}`, { |
| 82 | method: "POST", |
| 83 | headers: { ...headers(), "Content-Type": "application/json" }, |
| 84 | body: JSON.stringify(resource), |
| 85 | }); |
| 86 | return handleResponse(res); |
| 87 | } |
| 88 | |
| 89 | /** Update (PUT) a resource. */ |
| 90 | export async function k8sUpdate<T extends K8sResource>( |
no test coverage detected