mirror of
https://github.com/ION606/selmer-bot-website.git
synced 2026-05-15 06:26:54 +00:00
Fixed an async issue
This commit is contained in:
@@ -142,13 +142,13 @@ app.post('/sendData', async (req, res) => {
|
|||||||
try {
|
try {
|
||||||
const pref = JSON.parse(req.headers.serversettings);
|
const pref = JSON.parse(req.headers.serversettings);
|
||||||
|
|
||||||
connection.then((client) => {
|
connection.then(async (client) => {
|
||||||
const dbo = client.db(pref.Id).collection('SETUP');
|
const dbo = client.db(pref.Id).collection('SETUP');
|
||||||
|
|
||||||
await dbo.updateOne({ _id: 'WELCOME' }, {$set: { welcomechannel: pref.WELCOME.welcomechannel, welcomemessage: pref.WELCOME.welcomemessage }});
|
await dbo.updateOne({ _id: 'WELCOME' }, {$set: { welcomechannel: pref.WELCOME.welcomechannel, welcomemessage: pref.WELCOME.welcomemessage }});
|
||||||
await dbo.updateOne({ _id: 'LOG' }, {$set: { keepLogs: pref.LOG.keepLogs, logchannel: pref.LOG.logchannel, severity: pref.LOG.severity }});
|
await dbo.updateOne({ _id: 'LOG' }, {$set: { keepLogs: pref.LOG.keepLogs, logchannel: pref.LOG.logchannel, severity: pref.LOG.severity }});
|
||||||
}).then(() => { res.send("DONE"); })
|
}).then(() => { res.send("DONE"); })
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
res.send("FAILED");
|
res.send("FAILED");
|
||||||
|
|||||||
Reference in New Issue
Block a user