fix note patching for Pod (#8915)

pull/8720/head
Prabhat Khera 2 years ago committed by GitHub
parent 7197ca435a
commit 6a29198c5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,6 @@
import { User, Clock, Edit, ChevronDown, ChevronUp } from 'lucide-react';
import moment from 'moment';
import { useState } from 'react';
import { useEffect, useState } from 'react';
import { Pod } from 'kubernetes-types/core/v1';
import { useCurrentStateAndParams } from '@uirouter/react';
@ -60,9 +60,13 @@ export function ApplicationSummaryWidget() {
application?.metadata?.annotations?.[appNoteAnnotation];
const [isNoteOpen, setIsNoteOpen] = useState(true);
const [applicationNoteFormValues, setApplicationNoteFormValues] = useState(
applicationNote || ''
);
const [applicationNoteFormValues, setApplicationNoteFormValues] =
useState('');
useEffect(() => {
setApplicationNoteFormValues(applicationNote || '');
}, [applicationNote]);
const patchApplicationMutation = usePatchApplicationMutation(
environmentId,
namespace,

@ -44,9 +44,14 @@ export async function patchPod(
},
];
try {
return await axios.put<Pod>(
return await axios.patch<Pod>(
buildUrl(environmentId, namespace, name),
payload
payload,
{
headers: {
'Content-Type': 'application/json-patch+json',
},
}
);
} catch (e) {
throw parseAxiosError(e as Error, 'Unable to update pod');

Loading…
Cancel
Save