Correct some mistakes in the DB class
This commit is contained in:
parent
4b90031294
commit
8ab318ef12
1 changed files with 9 additions and 2 deletions
|
@ -29,7 +29,7 @@ export default class Database {
|
|||
}
|
||||
|
||||
if (data == null) {
|
||||
connection.execute(query, data, (err, result) => {
|
||||
connection.execute(query, (err, result) => {
|
||||
if (err) {
|
||||
connection.release();
|
||||
return reject(err);
|
||||
|
@ -38,7 +38,14 @@ export default class Database {
|
|||
resolve(result !== undefined);
|
||||
});
|
||||
} else {
|
||||
|
||||
connection.execute(query, data, (err, result) => {
|
||||
if (err) {
|
||||
connection.release();
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
resolve(result !== undefined);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue