v1.8.1
This commit is contained in:
parent
01fe8d0dbc
commit
d933f07eac
4 changed files with 28 additions and 1 deletions
|
@ -345,6 +345,24 @@ module.exports.insert = (listId, meta, subscription, callback) => {
|
|||
statusDirection = !existing ? (meta.status === 1 ? '+' : '-') : (existing.status === 1 ? '-' : '+');
|
||||
}
|
||||
|
||||
if (!keys.length) {
|
||||
// nothing to update
|
||||
return connection.commit(err => {
|
||||
if (err) {
|
||||
return connection.rollback(() => {
|
||||
connection.release();
|
||||
return callback(err);
|
||||
});
|
||||
}
|
||||
connection.release();
|
||||
return callback(null, {
|
||||
entryId,
|
||||
cid: meta.cid,
|
||||
inserted: !existing
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (!existing) {
|
||||
// insert as new
|
||||
keys = insertKeys.concat(keys);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue