Disable scenario property
This commit is contained in:
@@ -32,6 +32,10 @@ const scenarioSchema = new mongoose.Schema({
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isDisabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
requred: true
|
||||
|
||||
@@ -32,6 +32,7 @@ router.get('/', passport.ensureAuthenticated, async (req, res, next) => {
|
||||
if (req.user.role === "user") {
|
||||
filter.isAdminOnly = false;
|
||||
}
|
||||
filter.isDisabled = filter.isDisabled || false;
|
||||
const result = await db.scenario.get(filter);
|
||||
return res.json(result);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user