JSDoc for src/schemas/*.js complete. Just need to finish src/schemas/channel
This commit is contained in:
parent
1d5c1037ab
commit
b78d35d0f8
4 changed files with 114 additions and 2 deletions
|
|
@ -21,6 +21,9 @@ const {mongoose} = require('mongoose');
|
|||
const permissionModel = require("./permissionSchema");
|
||||
const defaultFlair = require("../../defaultFlair.json");
|
||||
|
||||
/**
|
||||
* DB Schema for documents representing chat flair
|
||||
*/
|
||||
const flairSchema = new mongoose.Schema({
|
||||
name:{
|
||||
type: mongoose.SchemaTypes.String,
|
||||
|
|
@ -38,6 +41,9 @@ const flairSchema = new mongoose.Schema({
|
|||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Function which runs on server startup to load un-loaded flairs from defaultFlair.json into the DB
|
||||
*/
|
||||
flairSchema.statics.loadDefaults = async function(){
|
||||
//Make sure registerFlair function is happy
|
||||
const _this = this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue