Commit b7117971 authored by 刘松's avatar 刘松

qd fix

parent a3fd00bb
......@@ -4,7 +4,8 @@ const {ObjectId} = mongoose.SchemaTypes;
const schema = mongoose.Schema({
name: {
type: String,
required: true
required: true,
unique: true
},
quan: {
type: String,
......
......@@ -121,7 +121,7 @@ exports.createLink = async (req, res, next) => {
exports.getSchedules = async (req, res, next) => {
let {limit = 100,skip = 0,sort = {'updatedAt': -1}} = req.query;
let options = {limit:parseInt(limit),skip:parseInt(skip),sort};
let schedules = await Schedule.find({},null,options).populate('links','name title target');
let schedules = await Schedule.find({},null,options).populate('links','name title target').populate('qd','user');
let total = await Schedule.count({},null);
res.send({ status:'ok',result:schedules,pagination:{total:total,skip:skip,limit:limit}});
}
......@@ -156,7 +156,6 @@ exports.createSchedule = async (req, res, next) => {
}
});
Promise.all(tkl_Tasks).then(function(arrs){
console.dir('----');
arrs.map(x => x.toJSON());
res.send({status:'ok',result:result,kls:arrs});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment