Skip to content

Commit

Permalink
perf(config): transform config to object
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed Jan 24, 2023
1 parent 528440e commit ff7c365
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/config/src/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ export class ConfigService {
*/
async getAllConfigs() {
const config = await this.configModel.find().lean();
return config;
const configMap = new Map();
config.forEach((c) => {
configMap.set(c.name, c.value);
});
return Object.fromEntries(configMap);
}

/**
Expand Down

0 comments on commit ff7c365

Please sign in to comment.