@headless-adminapp/app 0.0.17-alpha.38 → 0.0.17-alpha.39

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.
@@ -40,7 +40,7 @@ function useLoadFormGridPage(logicalName, formId) {
40
40
  loading: false,
41
41
  error: true,
42
42
  title: 'Schema not found',
43
- message: 'The schema was not found',
43
+ message: `The schema "${logicalName}" was not found`,
44
44
  };
45
45
  }
46
46
  if (!form) {
@@ -15,7 +15,7 @@ function useLoadMainGridPage(logicalName, viewId) {
15
15
  loading: false,
16
16
  error: true,
17
17
  title: 'Schema not found',
18
- message: 'The schema was not found',
18
+ message: `The schema "${logicalName}" was not found`,
19
19
  };
20
20
  }
21
21
  if (!view) {
@@ -1,2 +1,2 @@
1
1
  import { SchemaAttributes } from '@headless-adminapp/core/schema';
2
- export declare function useSchema<S extends SchemaAttributes = SchemaAttributes>(logicalName: string): import("@headless-adminapp/core/schema").Schema<S>;
2
+ export declare function useSchema<S extends SchemaAttributes = SchemaAttributes>(logicalName: string): import("@headless-adminapp/core/schema").Schema<S> | null;
@@ -4,5 +4,8 @@ exports.useSchema = useSchema;
4
4
  const useMetadata_1 = require("./useMetadata");
5
5
  function useSchema(logicalName) {
6
6
  const { schemaStore } = (0, useMetadata_1.useMetadata)();
7
+ if (!schemaStore.hasSchema(logicalName)) {
8
+ return null;
9
+ }
7
10
  return schemaStore.getSchema(logicalName);
8
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/app",
3
- "version": "0.0.17-alpha.38",
3
+ "version": "0.0.17-alpha.39",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -39,5 +39,5 @@
39
39
  "react-hook-form": "7.52.2",
40
40
  "yup": "^1.4.0"
41
41
  },
42
- "gitHead": "cf5abc4c56618fcc873bd31e3a26a84a9509edfa"
42
+ "gitHead": "2bfa7d267f5fa6beb476fda508c43661444dc894"
43
43
  }