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:
parent
8521995758
commit
6ae6c58f4c
14 changed files with 297 additions and 4751 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue