feat: add api support and auth
This commit is contained in:
parent
31e4b854db
commit
a244d98806
21 changed files with 585 additions and 63 deletions
|
|
@ -17,7 +17,6 @@ class AllowedString extends mongoose.SchemaType {
|
|||
}
|
||||
|
||||
cast(value: any) {
|
||||
console.log(value + ' is being validated')
|
||||
if (this.allowedValues.indexOf(value) === -1) {
|
||||
let validationStr: string = 'AllowedString: ' + value + ' must be one of which: [' + this.allowedValues.join(', ') + ']'
|
||||
console.log(validationStr)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
import mongoose, { Schema } from 'mongoose'
|
||||
|
||||
const Icon = new Schema({
|
||||
id: { type: String, required: true },
|
||||
width: { type: Number, required: true },
|
||||
height: { type: Number, required: true },
|
||||
path: { type: String, required: true }
|
||||
})
|
||||
|
||||
const _Tag = new Schema({
|
||||
name: { type: String, required: true },
|
||||
icon: { type: String, required: true },
|
||||
icon: { type: Icon, required: true },
|
||||
description: { type: String }
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue