Skip to content

Commit

Permalink
fix: counter extension data can not be updated
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Wang <[email protected]>
  • Loading branch information
ruibaby committed Jun 19, 2024
1 parent d5ae394 commit b792319
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ui/src/views/components/DataUpdateSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ const isSubmitting = ref(false);
async function handleSave() {
try {
isSubmitting.value = true;
await axios.put(
`${buildBaseApiUrl(props.scheme)}/${props.data?.metadata?.name}`,
dataEditorRef.value?.getData()
);
// metadata.name may appear in a form similar to `posts.content.halo.run/5152aea5-c2e8-4717-8bba-2263d46e19d5`
// so we need to use encodeURIComponent
const name = encodeURIComponent(props.data?.metadata?.name);
await axios.put(`${buildBaseApiUrl(props.scheme)}/${name}`, dataEditorRef.value?.getData());
Toast.success('保存成功');
queryClient.invalidateQueries({ queryKey: ['plugin-data-studio:data'] });
} catch (error) {
Expand Down

0 comments on commit b792319

Please sign in to comment.