Adjusted query/tag flow

This commit is contained in:
Wyatt Johnson
2017-05-09 15:01:01 -06:00
parent b8e530ca1f
commit 2e1bc8d75a
25 changed files with 476 additions and 343 deletions
+2 -41
View File
@@ -1,45 +1,7 @@
const mongoose = require('../services/mongoose');
const Schema = mongoose.Schema;
const PERMISSIONS = [
'ADMIN'
];
/**
* The Mongo schema for a Tag.
* @type {Schema}
*/
const TagSchema = new Schema({
id: {
type: String,
unique: true,
default: 'STAFF'
},
public: Boolean,
text: {
type: Schema.Types.Mixed,
default: null
},
permissions: [{
type: String,
enum: PERMISSIONS,
default: 'ADMIN'
}],
models: [String],
// Additional metadata stored on the field.
metadata: Schema.Types.Mixed
}, {
timestamps: {
createdAt: 'created_at',
updatedAt: 'updated_at'
}
});
const MODERATION_OPTIONS = [
'PRE',
'POST'
];
const TagSchema = require('./schema/tag');
const MODERATION_OPTIONS = require('./enum/moderation_options');
/**
* SettingSchema manages application settings that get used on front and backend.
@@ -156,4 +118,3 @@ SettingSchema.method('merge', function(src) {
const Setting = mongoose.model('Setting', SettingSchema);
module.exports = Setting;
module.exports.MODERATION_OPTIONS = MODERATION_OPTIONS;