Skip to content
Snippets Groups Projects

Fix error #124

Merged boian requested to merge fix124-image-upload into master
All threads resolved!
1 file
+ 13
2
Compare changes
  • Side-by-side
  • Inline
+ 13
2
@@ -200,9 +200,20 @@ export default class newEvent extends EditView {
Object.keys(images).forEach(key => imageForm.append(key, images[key]));
imageForm.append('_id', _id);
imageForm.append('_etag', _etag);
this.controller.patch(imageForm).then(() => this.controller.changeModus('view'));
this.controller.patch(imageForm).then(() => {
m.route.set(`/events/${_id}`);
})
.catch(() => {
this.controller.id = _id;
this.controller.handler.getItem(_id).then((item) => {
this.controller.data = item;
this.form.data = item;
this.controller.changeModus('edit');
window.history.replaceState({}, '', `/events/${_id}`);
});
});
} else {
this.controller.changeModus('view');
m.route.set(`/events/${_id}`);
}
});
} else {
Loading