change 'account' field in Moderation model to 'username'

merge-requests/1/merge
Matthew 2019-10-26 00:02:26 -04:00
parent 0e13cfaf48
commit 38f48bb324
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 20 additions and 4 deletions

View File

@ -1,23 +1,39 @@
import { Document, Schema, model } from 'mongoose'; import { Document, Schema, model } from 'mongoose';
import { ModerationInterface } from '.';
export interface ModerationInterface extends Document { export interface ModerationInterface extends Document {
account: string, username: string,
userID: string, userID: string,
logID: string, logID: string,
moderatorID: string, moderatorID: string,
reason: string, reason: string,
type: string, /**
date: Date * @field 0 - Create
* @field 1 - Warn
* @field 2 - Lock
* @field 3 - Unlock
* @field 4 - Delete
*/
type: 0 | 1 | 2 | 3 | 4
date: Date,
expiration: {
date: Date,
processed: boolean
}
} }
const Moderation: Schema = new Schema({ const Moderation: Schema = new Schema({
account: String, username: String,
userID: String, userID: String,
logID: Number, logID: Number,
moderatorID: String, moderatorID: String,
reason: String, reason: String,
type: String, type: String,
date: Date, date: Date,
expiration: {
date: Date,
processed: Boolean,
},
}); });
export default model<ModerationInterface>('Moderation', Moderation); export default model<ModerationInterface>('Moderation', Moderation);