1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-20 12:09:36 +02:00

Local search for apps

This commit is contained in:
unknown 2021-09-06 12:24:01 +02:00
parent 8521995758
commit 6ae6c58f4c
14 changed files with 297 additions and 4751 deletions

View file

@ -9,27 +9,27 @@ const initConfig = async () => {
const configPairs = await Config.findAll({
where: {
key: {
[Op.or]: config.map(pair => pair.key)
}
}
})
[Op.or]: config.map((pair) => pair.key),
},
},
});
// Get key from each pair
const configKeys = configPairs.map((pair) => pair.key);
// Create missing pairs
config.forEach(async ({ key, value}) => {
config.forEach(async ({ key, value }) => {
if (!configKeys.includes(key)) {
await Config.create({
key,
value,
valueType: typeof value
})
valueType: typeof value,
});
}
})
});
logger.log('Initial config created');
return;
}
};
module.exports = initConfig;
module.exports = initConfig;