basic UI for row editing

This commit is contained in:
muerwre 2019-02-11 15:36:55 +07:00
parent 3ea920c1f8
commit 32e1b4c3fd
13 changed files with 248 additions and 65 deletions

View file

@ -4,15 +4,15 @@ const { generateGuest, generateRandomUrl } = require('./guest');
module.exports = async (req, res) => {
const { id, token } = req.query;
const user = await User.findOne({ _id: id, token })
.populate({
path: 'routes',
select: '_id title distance owner updated_at',
options: {
limit: 200,
sort: { updated_at: -1 },
}
});
const user = await User.findOne({ _id: id, token });
// .populate({
// path: 'routes',
// select: '_id title distance owner updated_at',
// options: {
// limit: 200,
// sort: { updated_at: -1 },
// }
// })
const random_url = await generateRandomUrl();

View file

@ -32,12 +32,12 @@ module.exports = async (req, res) => {
{
...criteria,
},
'_id title distance owner updated_at',
'_id title distance owner updated_at is_public',
{
limit: 500,
sort: { updated_at: -1 },
}
).populate('owner');
).populate('owner', '_id');
list = list.filter(item => (
!author || item.owner._id === author