Fixed some editor image/drawing upload endpoints

Fixes #1428
This commit is contained in:
Dan Brown 2019-05-07 22:23:44 +01:00
parent 4329fee2c9
commit 7ef059e254
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 4 additions and 4 deletions

View File

@ -298,7 +298,7 @@ class MarkdownEditor {
formData.append('file', file, remoteFilename);
formData.append('uploaded_to', context.pageId);
window.$http.post('/images/gallery/upload', formData).then(resp => {
window.$http.post('/images/gallery', formData).then(resp => {
const newContent = `[![${selectedText}](${resp.data.thumbs.display})](${resp.data.url})`;
replaceContent(placeHolderText, newContent);
}).catch(err => {
@ -366,7 +366,7 @@ class MarkdownEditor {
uploaded_to: Number(document.getElementById('page-editor').getAttribute('page-id'))
};
window.$http.post(window.baseUrl('/images/drawing/upload'), data).then(resp => {
window.$http.post(window.baseUrl('/images/drawio'), data).then(resp => {
this.insertDrawing(resp.data, cursorPos);
DrawIO.close();
}).catch(err => {
@ -402,7 +402,7 @@ class MarkdownEditor {
uploaded_to: Number(document.getElementById('page-editor').getAttribute('page-id'))
};
window.$http.post(window.baseUrl(`/images/drawing/upload`), data).then(resp => {
window.$http.post(window.baseUrl(`/images/drawio`), data).then(resp => {
let newText = `<div drawio-diagram="${resp.data.id}"><img src="${resp.data.url}"></div>`;
let newContent = this.cm.getValue().split('\n').map(line => {
if (line.indexOf(`drawio-diagram="${drawingId}"`) !== -1) {

View File

@ -53,7 +53,7 @@ async function uploadImageFile(file, wysiwygComponent) {
formData.append('file', file, remoteFilename);
formData.append('uploaded_to', wysiwygComponent.pageId);
const resp = await window.$http.post(window.baseUrl('/images/gallery/upload'), formData);
const resp = await window.$http.post(window.baseUrl('/images/gallery'), formData);
return resp.data;
}