Skip to content

Commit

Permalink
fix: unlink template fix
Browse files Browse the repository at this point in the history
  • Loading branch information
neatbyte-vnobis committed Jan 18, 2024
1 parent 3d87f48 commit d69203f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/api-page-builder/src/graphql/crud/pages.crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,11 @@ export const createPageCrud = (params: CreatePageCrudParams): PagesCrud => {
// Delete template-related data.
const allTemplateVariableIds = processedPage
.content!.data.template.variables.map((variablesForBlock: Record<string, any>) => {
return variablesForBlock.variables.map((v: Record<string, any>) => v.id);
if (Array.isArray(variablesForBlock.variables)) {
return variablesForBlock.variables.map((v: Record<string, any>) => v.id);
}

return [];
})
.flat();

Expand Down

0 comments on commit d69203f

Please sign in to comment.