Skip to content

Commit

Permalink
Sync ContentInstance interface across packages #6530 (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvega190 authored Mar 15, 2024
1 parent fe243da commit ad2d9c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
3 changes: 3 additions & 0 deletions packages/content/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ export function parseProps<Props = object, Target = object>(
// Should never happen but just in case the value is not numeric, rollback to original string
if (isNaN(parsedValue)) parsedValue = value;
break;
case 'placeInNav':
parsedValue = value === 'true';
break;
}
// @ts-ignore
parsed.craftercms[propName] = parsedValue;
Expand Down
19 changes: 10 additions & 9 deletions packages/models/src/ContentInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@

export interface ContentInstance {
craftercms: {
id: string
path: string
label: string // "Internal name"
dateCreated: string
dateModified: string
contentTypeId: string
orderInNav?: number // For pages only
disabled: boolean
sourceMap?: { [path: string]: string } // path: contentTypeId
id: string;
path: string | null;
label: string; // Internal name
dateCreated: string;
dateModified: string;
contentTypeId: string;
sourceMap?: Record<string, string>; // { fieldId: path }
disabled: boolean;
orderInNav?: number;
placeInNav?: boolean;
}
[prop: string]: any
}

0 comments on commit ad2d9c7

Please sign in to comment.