Skip to content

Commit

Permalink
Merge pull request #2155 from headlamp-k8s/apiproxy-post-changes
Browse files Browse the repository at this point in the history
frontend: Adds JSON / object / KubeObjectInterface options
  • Loading branch information
joaquimrocha authored Jul 12, 2024
2 parents 21515d1 + ff97e80 commit a976bf1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/lib/k8s/apiProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,11 @@ function singleApiFactory(group: string, version: string, resource: string) {
queryParams?: QueryParameters,
cluster?: string
) => streamResult(url, name, cb, errCb, queryParams, cluster),
post: (body: KubeObjectInterface, queryParams?: QueryParameters, cluster?: string) =>
post(url + asQuery(queryParams), body, true, { cluster }),
post: (
body: JSON | object | KubeObjectInterface,
queryParams?: QueryParameters,
cluster?: string
) => post(url + asQuery(queryParams), body, true, { cluster }),
put: (body: KubeObjectInterface, queryParams?: QueryParameters, cluster?: string) =>
put(`${url}/${body.metadata.name}` + asQuery(queryParams), body, true, { cluster }),
patch: (body: OpPatch[], name: string, queryParams?: QueryParameters, cluster?: string) =>
Expand Down

0 comments on commit a976bf1

Please sign in to comment.