fix(settings): streamline settings type creation in settingsService and initialization
- Refactored settingsService to use findOrCreate for settings type, improving efficiency and error handling. - Added initialization for 'account' settings type in initializeSettings, ensuring all necessary settings are created during setup.
This commit is contained in:
@@ -17,10 +17,14 @@ const initializeSettings = async () => {
|
||||
where: { name: 'flirt' },
|
||||
defaults: { name: 'flirt' }
|
||||
});
|
||||
await SettingsType.findOrCreate({
|
||||
where: { name: 'account' },
|
||||
defaults: { name: 'account' }
|
||||
});
|
||||
await SettingsType.findOrCreate({
|
||||
where: { name: 'languageAssistant' },
|
||||
defaults: { name: 'languageAssistant' }
|
||||
});
|
||||
};
|
||||
|
||||
export default initializeSettings;
|
||||
export default initializeSettings;
|
||||
|
||||
Reference in New Issue
Block a user