You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
frontend/src/app/structures/PageRecord.ts

59 lines
1.4 KiB

export default class PageRecord {
public UUID: string;
public Name: string;
public OrgUserId: string;
public IsPublic = true;
public IsVisibleInMenu = true;
public ParentId: string;
public NodeIds: Array<string>;
public CreatedAt: Date;
public UpdatedAt: Date;
public CreatedUserId: string;
public UpdateUserId: string;
public ChildPageIds: Array<string>;
constructor(data: any = {Name: 'Click to edit title...'}) {
[
'UUID',
'Name',
'OrgUserId',
'IsPublic',
'IsVisibleInMenu',
'ParentId',
'NodeIds',
'CreatedAt',
'UpdatedAt',
'CreatedUserId',
'UpdateUserId',
'ChildPageIds'
].forEach(field => {
if ( field in data ) {
this[field] = data[field];
}
});
}
toSave() {
const data = {};
[
'UUID',
'Name',
'OrgUserId',
'IsPublic',
'IsVisibleInMenu',
'ParentId',
'NodeIds',
'CreatedAt',
'UpdatedAt',
'CreatedUserId',
'UpdateUserId',
'ChildPageIds'
].forEach(field => {
if ( field in this ) {
data[field] = this[field];
}
});
return data;
}
}