@drax/settings-back 0.11.5 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,10 +41,10 @@ class SettingService extends AbstractService<ISetting, ISettingBase, ISettingBas
41
41
  async fetchGrouped(): Promise<{ [key: string]: ISetting[] }> {
42
42
  const settings = await this._repository.fetchAll()
43
43
  return settings.reduce((acc, setting) => {
44
- if (!acc[setting.group]) {
45
- acc[setting.group] = [];
44
+ if (!acc[setting.category]) {
45
+ acc[setting.category] = [];
46
46
  }
47
- acc[setting.group].push(setting);
47
+ acc[setting.category].push(setting);
48
48
  return acc;
49
49
  }, {} as { [key: string]: ISetting[] });
50
50
  }
@@ -92,7 +92,7 @@ class SettingService extends AbstractService<ISetting, ISettingBase, ISettingBas
92
92
  const setting = await this._repository.findOneBy("key", data.key)
93
93
  if (setting) {
94
94
  delete data.value
95
- return await this._repository.updatePartial(setting.id, data)
95
+ return await this._repository.updatePartial(setting._id, data)
96
96
  } else {
97
97
  return await this._repository.create(data)
98
98
  }