Fixing id bug on client add

This commit is contained in:
Fabian Stamm 2018-11-10 19:00:45 +01:00
parent 24f4f12845
commit ed8b33aaa1

View File

@ -143,8 +143,8 @@ Handlebars.registerHelper("formatDate", function (datetime, format) {
console.log(elm); console.log(elm);
let data = getFormData(elm); let data = getFormData(elm);
console.log(data); console.log(data);
let id = data._id; let id = data.id;
delete data._id; delete data.id;
if (id && id !== "") { if (id && id !== "") {
request("/api/admin/client?id=" + id, "PUT", data).then(() => setCustomCard()).then(() => loadList()).catch(catchError) request("/api/admin/client?id=" + id, "PUT", data).then(() => setCustomCard()).then(() => loadList()).catch(catchError)
} else { } else {