add new record

This commit is contained in:
AJ ONeal 2018-01-29 11:35:34 -07:00
parent 92056f6d55
commit 656c803720
2 changed files with 29 additions and 23 deletions

View File

@ -261,7 +261,7 @@ module.exports.create = function (cli, engine/*, dnsd*/) {
});
} else {
engine.records.save(record, function (err, record) {
res.send({ success: true });
res.send({ success: true, id: record.id });
});
}
});

View File

@ -361,7 +361,10 @@
});
}
if (change) {
if (!change) {
return;
}
renderRecords();
return window.fetch(
@ -381,10 +384,13 @@
return;
}
console.log('result:', data);
});
});
if (!record.id) {
record.id = data.id;
renderRecords();
}
});
});
});
$qs('select.js-record-form-type').value = '';
// Create a new 'change' event and dispatch it.