To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 40536ef9 authored by boian's avatar boian Committed by Hermann
Browse files

Fix error #124

When creating a new Event with badly formatted images, a new event was
created without the images but the user was not notified of this. This
led to an event being created multiple times. With this commit the user
is redirected to an edit event view where he can change the images.
parent 8b2ad791
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment