Skip to content

Commit

Permalink
Merge branch 'mongoose' of https://github.com/austenstone/github-value
Browse files Browse the repository at this point in the history
…into mongoose
  • Loading branch information
MattG57 committed Jan 23, 2025
2 parents dbad5c0 + feb4c76 commit 3f4a35b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/src/services/settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ class SettingsService {
async getAllSettings() {
try {
const Setting = mongoose.model('Settings');
return await Setting.find<{
const settingsArray = await Setting.find<{
name: string;
value: string;
}>({});
return settingsArray.reduce((acc, setting) => {
acc[setting.name] = setting.value;
return acc;
}, {} as any);

Check failure

Code scanning / ESLint

Disallow the `any` type Error

Unexpected any. Specify a different type.
} catch (error) {
console.error('Failed to get all settings:', error);
throw error;
Expand Down

0 comments on commit 3f4a35b

Please sign in to comment.