forked from j62/ctbrec
1
0
Fork 0

Fix: show notification and clear input field after adding a model

This commit is contained in:
0xb00bface 2023-11-12 17:58:08 +01:00
parent 41ffd75d48
commit 98aa9bc148
1 changed files with 16 additions and 13 deletions

View File

@ -305,7 +305,7 @@
}
let ctbrec = {
add: function(input, onsuccess) {
add: function(input, duration, onsuccess) {
try {
let model = {
type: null,
@ -326,8 +326,11 @@
data: msg
})
.done(function(data) {
console.log(data);
if (data.status === 'success') {
if (onsuccess) {
onsuccess.call(data);
}
$.notify('Model added', 'info');
} else {
$.notify('Adding model failed', 'error');