From 7c8bcd928f54d6851da30eb05b3b936d8d7e98ae Mon Sep 17 00:00:00 2001 From: garrettmills Date: Sat, 8 Feb 2020 08:07:26 -0600 Subject: [PATCH] Update page model relationships --- app/models/api/Page.model.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/api/Page.model.js b/app/models/api/Page.model.js index cb7b390..cf1fad7 100644 --- a/app/models/api/Page.model.js +++ b/app/models/api/Page.model.js @@ -16,7 +16,7 @@ class Page extends Model { return { UUID: {type: String, default: () => uuid()}, Name: String, - OrgUserId: String, + OrgUserId: ObjectId, IsPublic: {type: Boolean, default: true}, IsVisibleInMenu: {type: Boolean, default: true}, ParentId: String, @@ -37,16 +37,16 @@ class Page extends Model { get nodes() { const Node = this.models.get("api:Node"); - return this.has_many(Node, "NodeIds", "_id"); + return this.has_many(Node, "NodeIds", "UUID"); } get childPages() { const Page = this.models.get("api:Page") - return this.has_many(Page, "ChildPageIds", "_id") + return this.has_many(Page, "ChildPageIds", "UUID") } get parent() { const Parent = this.models.get("api:Page") - return this.belongs_to_one(Parent, "ParentId", "_id") + return this.belongs_to_one(Parent, "ParentId", "UUID") } accessible_by(user, mode = 'view') {