Merge pull request #18194 from ashinsabu/fix-18172

fixes #18172: manifest type can now be undefined as well
This commit is contained in:
Fredrik Adelöw
2023-06-13 15:39:41 +02:00
committed by GitHub
3 changed files with 11 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-react': minor
---
Fixed typescript casting bug for useTemplateParameterSchema hook
+1 -1
View File
@@ -289,7 +289,7 @@ export const useFormDataFromQuery: (
// @alpha (undocumented)
export const useTemplateParameterSchema: (templateRef: string) => {
manifest: TemplateParameterSchema;
manifest: TemplateParameterSchema | undefined;
loading: boolean;
error: Error | undefined;
};
@@ -29,5 +29,9 @@ export const useTemplateParameterSchema = (templateRef: string) => {
[scaffolderApi, templateRef],
);
return { manifest: value as TemplateParameterSchema, loading, error };
return {
manifest: value as TemplateParameterSchema | undefined,
loading,
error,
};
};