Correct some mistakes in the DB class

This commit is contained in:
Holly Stubbs 2023-10-04 15:12:35 +01:00
parent 4b90031294
commit 8ab318ef12

View file

@ -29,7 +29,7 @@ export default class Database {
} }
if (data == null) { if (data == null) {
connection.execute(query, data, (err, result) => { connection.execute(query, (err, result) => {
if (err) { if (err) {
connection.release(); connection.release();
return reject(err); return reject(err);
@ -38,7 +38,14 @@ export default class Database {
resolve(result !== undefined); resolve(result !== undefined);
}); });
} else { } else {
connection.execute(query, data, (err, result) => {
if (err) {
connection.release();
return reject(err);
}
resolve(result !== undefined);
});
} }
}); });
}); });