mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Adjusted query/tag flow
This commit is contained in:
+2
-41
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user