fixes #10755: Changed description change method for service connections from 'Put' to 'PATCH' (#10876)

* Changed description change method for service connections from 'Put' to 'PATCH'

* worked on comments

---------

Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com>
This commit is contained in:
Aniket Katkar 2023-04-06 19:42:17 +05:30 committed by GitHub
parent 8e3e0002db
commit 942649f3b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -753,21 +753,16 @@ const ServicePage: FunctionComponent = () => {
if (description !== updatedHTML && !isUndefined(serviceDetails)) {
const { id } = serviceDetails;
const updatedServiceDetails = {
connection: serviceDetails?.connection,
name: serviceDetails.name,
serviceType: serviceDetails.serviceType,
const updatedData: ServicesType = {
...serviceDetails,
description: updatedHTML,
owner: serviceDetails.owner,
} as ServicesUpdateRequest;
};
const jsonPatch = compare(serviceDetails, updatedData);
try {
const response = await updateService(
serviceName,
id,
updatedServiceDetails
);
setDescription(updatedHTML);
const response = await updateOwnerService(serviceName, id, jsonPatch);
setDescription(response.description ?? '');
setServiceDetails(response);
} catch (error) {
showErrorToast(error as AxiosError);