Add delete for pages, active scope to model
This commit is contained in:
@@ -2,6 +2,8 @@ const Model = require("flitter-orm/src/model/Model");
|
||||
const { ObjectId } = require("mongodb");
|
||||
const uuid = require('uuid/v4');
|
||||
|
||||
const ActiveScope = require('../scopes/Active.scope')
|
||||
|
||||
/*
|
||||
* Page Model
|
||||
* -------------------------------------------------------------
|
||||
@@ -23,12 +25,16 @@ class Page extends Model {
|
||||
NodeIds: [String],
|
||||
CreatedAt: {type: Date, default: () => new Date},
|
||||
UpdatedAt: {type: Date, default: () => new Date},
|
||||
DeletedAt: Date,
|
||||
Active: {type: Boolean, default: true},
|
||||
CreatedUserId: {type: String},
|
||||
UpdateUserId: {type: String},
|
||||
ChildPageIds: [String],
|
||||
};
|
||||
}
|
||||
|
||||
static scopes = [new ActiveScope]
|
||||
|
||||
// Static and instance methods can go here
|
||||
get user() {
|
||||
const User = this.models.get("auth:User");
|
||||
|
||||
Reference in New Issue
Block a user