mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-16 15:56:31 +02:00
correction quel que probleme , wl system , owner system + permssion system
This commit is contained in:
@@ -46,14 +46,13 @@ async function getOwnerData(db, botId) {
|
||||
|
||||
async function updateOwnerData(db, botId, data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => {
|
||||
const updatedData = JSON.stringify(data);
|
||||
db.run('UPDATE gestion SET value = ? WHERE id = ?', [updatedData, botId], (err) => {
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
reject(err);
|
||||
} else {
|
||||
const data = row ? JSON.parse(row.value) : {};
|
||||
data.owners = data.owners || {}; // Ensure owners is always an object
|
||||
resolve(data);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user