Skip to content

Commit

Permalink
fix: use blocks key to define page type (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
martyanovandrey authored Mar 31, 2024
1 parent 2888503 commit fe016ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ export function getPageType({
leading,
}: DocLeadingPageData | (DocPageData & {data?: undefined}) | DocContentPageData): DocumentType {
if (leading && data) {
return Object.prototype.hasOwnProperty.call(data, 'links')
? DocumentType.Leading
: DocumentType.PageConstructor;
return Object.prototype.hasOwnProperty.call(data, 'blocks')
? DocumentType.PageConstructor
: DocumentType.Leading;
}

return DocumentType.Base;
Expand Down

0 comments on commit fe016ef

Please sign in to comment.