commit
This commit is contained in:
parent
6781c7ff91
commit
fcd80c5ac8
3 changed files with 43 additions and 4 deletions
|
@ -95,4 +95,20 @@ function delConv (convName) {
|
|||
});
|
||||
}
|
||||
|
||||
module.exports = { addUserToDb, incrementQuota, usersInDb, getQuota, addConv, delConv };
|
||||
function getConvs() {
|
||||
return new Promise((resolve, reject) => {
|
||||
connection.query('SELECT name FROM conversations', (error, results, fields) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
convs = [];
|
||||
results.forEach(element => {
|
||||
convs.push(element.name);
|
||||
});
|
||||
resolve(convs);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = { addUserToDb, incrementQuota, usersInDb, getQuota, addConv, delConv, getConvs };
|
Loading…
Add table
Add a link
Reference in a new issue