mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
backend: populated routes
This commit is contained in:
parent
723ab51eef
commit
6ffdca22d7
5 changed files with 25 additions and 9 deletions
|
@ -4,7 +4,13 @@ const { generateGuest, generateRandomUrl } = require('./guest');
|
|||
module.exports = async (req, res) => {
|
||||
const { id, token } = req.query;
|
||||
|
||||
const user = await User.findOne({ _id: id, token });
|
||||
const user = await User.findOne({ _id: id, token }).populate({
|
||||
path: 'routes',
|
||||
options: {
|
||||
limit: 100,
|
||||
sort: { updated: 1 },
|
||||
}
|
||||
});
|
||||
const random_url = await generateRandomUrl();
|
||||
|
||||
if (user) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue