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 5b98f962 authored by Hermann's avatar Hermann
Browse files

update itemcontroller and editUser to the recent changes in the patch function arugments

parent 255d8e32
...@@ -31,9 +31,9 @@ export default class ItemController { ...@@ -31,9 +31,9 @@ export default class ItemController {
}); });
} }
patch(data, formData = false) { patch(data) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.handler.patch(data, formData).then(() => { this.changeModus('view'); }).catch(reject); this.handler.patch(data).then(() => { this.changeModus('view'); }).catch(reject);
}); });
} }
......
...@@ -5,22 +5,9 @@ import { apiUrl } from 'networkConfig'; ...@@ -5,22 +5,9 @@ import { apiUrl } from 'networkConfig';
import EditView from '../views/editView'; import EditView from '../views/editView';
export default class UserEdit extends EditView { export default class UserEdit extends EditView {
constructor(vnode) {
super(vnode);
this.pw = new Form();
}
oninit() {
// load schema
m.request(`${apiUrl}/docs/api-docs`).then((schema) => {
this.pw.setSchema(JSON.parse(JSON.stringify(schema.definitions.User)));
this.form.setSchema(schema.definitions.User);
}).catch((error) => { console.log(error); });
}
beforeSubmit() { beforeSubmit() {
if ('rfid' in this.form.data && !this.form.data.rfid) delete this.form.data.rfid; if ('rfid' in this.form.data && !this.form.data.rfid) delete this.form.data.rfid;
this.submit(); this.submit(this.form.data);
} }
view() { view() {
......
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