Merge pull request #18194 from ashinsabu/fix-18172
fixes #18172: manifest type can now be undefined as well
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-react': minor
|
||||
---
|
||||
|
||||
Fixed typescript casting bug for useTemplateParameterSchema hook
|
||||
@@ -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,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user