fix for #75, fix for adding image to entry text

pull/84/head
Ro 3 years ago
parent f119bdc773
commit 03c629462b

File diff suppressed because one or more lines are too long

@ -266,7 +266,8 @@ class MaintenanceManager {
} }
}; };
if (requestType == REQUEST_TYPE_PUT || requestType == REQUEST_TYPE_POST) { if (requestType == REQUEST_TYPE_PUT || requestType == REQUEST_TYPE_POST) {
//if (eventType === TASK_UPLOAD_FILES) request.setRequestHeader("fipamo-access-token", self.token); if (eventType === TASK_UPLOAD_FILES)
request.setRequestHeader("fipamo-access-token", self.token);
switch (contentType) { switch (contentType) {
case CONTENT_TYPE_JSON: case CONTENT_TYPE_JSON:
request.setRequestHeader( request.setRequestHeader(

@ -20,6 +20,7 @@ export default class PostEditor {
this.processing = false; this.processing = false;
let self = this; let self = this;
this.admin = new FipamoAdminAPI(null); this.admin = new FipamoAdminAPI(null);
this.mm = new Maintenance();
this.urlPieces = document.URL.split("/"); this.urlPieces = document.URL.split("/");
this.post = []; this.post = [];
this.postID = null; this.postID = null;
@ -250,12 +251,16 @@ export default class PostEditor {
handleImageUpload(type, files) { handleImageUpload(type, files) {
let self = this; let self = this;
notify.alert("Uploading Image", null); notify.alert("Uploading Image", null);
let mm = new Maintenance();
mm.imageUpload(type, files) self.mm
.imageUpload(type, files)
.then((r) => { .then((r) => {
if (r.type == DataEvent.POST_IMAGE_ADDED) if (r.type == DataEvent.POST_IMAGE_ADDED) {
self.editor.notify(EditorEvent.EDITOR_UPLOAD_POST_IMAGE, r.url); self.editor.notify(EditorEvent.EDITOR_UPLOAD_POST_IMAGE, r.url);
notify.alert("Image Added to Entry", true); notify.alert("Image Added to Entry", true);
} else {
notify.alert("Uh oh. Image not added", false);
}
}) })
.catch(() => { .catch(() => {
notify.alert("Uh oh. Image not added", false); notify.alert("Uh oh. Image not added", false);

Loading…
Cancel
Save