@raketa-cloud/admin 0.0.95 → 0.0.96

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-cloud/admin",
3
- "version": "0.0.95",
3
+ "version": "0.0.96",
4
4
  "main": "src/index.js",
5
5
  "scripts": {
6
6
  "dev": "npx tailwindcss -i ./src/styles/application.css -o ../../apps/admin/static/application.css --watch",
@@ -108,6 +108,11 @@ export default class RaketaClient {
108
108
  );
109
109
  }
110
110
 
111
+ logError(message, ctx) {
112
+ if (ctx) console.error(ctx);
113
+ throw new Error(message);
114
+ }
115
+
111
116
  formatErrors(errors, generalErrorTo = null) {
112
117
  const result = {};
113
118
 
@@ -7,12 +7,16 @@ import {
7
7
  export default class Settings extends RaketaClient {
8
8
  async find(locale) {
9
9
  const {
10
- setting: { value },
10
+ setting,
11
11
  } = await this.query(SettingDocument, {
12
12
  locale,
13
13
  });
14
14
 
15
- return value;
15
+ if (!setting?.value) {
16
+ this.logError(`Cannot find settings for ${locale} locale.`)
17
+ }
18
+
19
+ return setting.value;
16
20
  }
17
21
 
18
22
  async update(locale, params) {