refactor: fieldGroupName => __typename
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 58s

This commit is contained in:
2025-09-25 15:30:10 -04:00
parent ed479312fa
commit e041408715
6 changed files with 89 additions and 21 deletions

View File

@@ -5,8 +5,8 @@ const sections = {
GroupAbstractBuilderSectionsTextBlockLayout: SectionTextBlock,
} as const;
export function useSection({ fieldGroupName, ...attrs }: TheSectionFragment) {
const component = sections[fieldGroupName as keyof typeof sections];
export function useSection({ __typename, ...attrs }: TheSectionFragment) {
const component = sections[__typename as keyof typeof sections];
if (!component) throw createError({ statusCode: 500, statusMessage: "Erreur interne", message: "Type de section invalide." });
return { component, attrs };
}