mirror of https://github.com/portainer/portainer
fix note patching for Pod (#8915)
parent
7197ca435a
commit
6a29198c5c
|
@ -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…
Reference in New Issue