Fixing error on client creation

This commit is contained in:
Fabian Stamm 2018-11-10 18:56:32 +01:00
parent 6580cbf667
commit 24f4f12845
1 changed files with 1 additions and 1 deletions

View File

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