Skip to content

Commit

Permalink
fix: delete ckeditor files from api
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Guillemin committed Sep 13, 2023
1 parent fb72677 commit ce2da65
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/webapp/src/components/richtext/RichText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export default {
editorState: undefined,
};
},
inject: ['publisher'],
inject: ['publisher', 'linkedFilesToContent', 'setLinkedFilesToContent'],
methods: {
onReady(editor) {
// Get already uploaded files
Expand Down Expand Up @@ -263,6 +263,10 @@ export default {
files.forEach((fileURI) => {
const isPublic = fileURI.startsWith('files/') ? true : false;
FileManagerService.delete(this.publisher.context.organization.id, isPublic, Base64Utils.encode(fileURI));
let index = this.linkedFilesToContent.findIndex((element) => element.uri === fileURI);
let newValue = Array.from(this.linkedFilesToContent || []);
this.setLinkedFilesToContent(newValue.filter((element, i) => i != index));
});
},
getUploadedFiles(editorData) {
Expand Down

0 comments on commit ce2da65

Please sign in to comment.