Skip to content

Commit

Permalink
fix(console): change update application api to patch (#2203)
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-hnny committed Dec 6, 2022
1 parent 12c9025 commit 867710d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 3 additions & 1 deletion web/console/helpers/request.ts
Expand Up @@ -27,6 +27,7 @@ export class RequestArgs {
clusterId?: string;
projectId?: string;
keyword?: string;
headers?: Record<string, string>;
}

export class RequestResult {
Expand All @@ -39,7 +40,8 @@ export const SEND = async (args: RequestArgs) => {
const params: RequestParams = {
method: args.method,
url: args.url,
data: args.bodyData
data: args.bodyData,
userDefinedHeader: args?.headers ?? {}
};
const resp = new RequestResult();
try {
Expand Down
19 changes: 18 additions & 1 deletion web/console/src/modules/application/WebAPI.ts
Expand Up @@ -160,7 +160,24 @@ export async function updateApp([appInfo]) {
specificName: appInfo.metadata.name,
isSpecialNamespace: true
});
const rr: RequestResult = await PUT({ url, bodyData: appInfo });
// const rr: RequestResult = await PUT({ url, bodyData: appInfo });
const rr: RequestResult = await PATCH({
url,
bodyData: {
spec: {
chart: {
...appInfo?.spec?.chart
},

values: {
rawValues: appInfo?.spec?.values?.rawValues
}
}
},
headers: {
'Content-Type': 'application/strategic-merge-patch+json'
}
});
return operationResult(rr.data, rr.error);
}

Expand Down

0 comments on commit 867710d

Please sign in to comment.