feat: add api support and auth

This commit is contained in:
Matthieu Bessat 2020-07-10 22:44:01 +02:00
parent 31e4b854db
commit a244d98806
21 changed files with 585 additions and 63 deletions

View file

@ -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)

View file

@ -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 }
})