Table MySkills

This commit is contained in:
Paolo Arena
2021-10-08 00:38:35 +02:00
parent 87739a5847
commit 300ab15ca7
10 changed files with 1421 additions and 903 deletions

View File

@@ -23,7 +23,13 @@ const LevelSchema = new Schema({
years_of_exp: {
type: Number,
},
}, {_id: false});
color: {
type: String,
},
theme: {
type: String,
},
});
LevelSchema.pre('save', async function (next) {
if (this.isNew) {
@@ -33,7 +39,6 @@ LevelSchema.pre('save', async function (next) {
this._id = 1;
else
this._id = myrec._doc._id + 1;
} else {
this._id = 1;
}
@@ -47,7 +52,7 @@ LevelSchema.statics.findAllIdApp = function(idapp) {
const Level = this;
const query = [
{$sort: {descr: 1}},
{$sort: {_id: 1}},
];
return Level.aggregate(query).then((arrrec) => {
@@ -58,7 +63,6 @@ LevelSchema.statics.findAllIdApp = function(idapp) {
LevelSchema.statics.getFieldsForSearch = function() {
return [
{field: 'label', type: tools.FieldType.string},
{field: 'descr', type: tools.FieldType.string}];
};