map_list: initial

urls: editing now handled through urls
This commit is contained in:
muerwre 2018-12-05 14:16:23 +07:00
parent 3771e5d338
commit 0d9bad9095
23 changed files with 386 additions and 68 deletions

View file

@ -13,6 +13,7 @@ const RouteSchema = new Schema(
owner: { type: Schema.Types.ObjectId, ref: 'User' },
logo: { type: String, default: 'DEFAULT' },
distance: { type: Number, default: 0 },
public: { type: Boolean, default: true },
},
{
timestamps: { createdAt: 'created_at', updatedAt: 'updated_at' }

View file

@ -1,3 +1,4 @@
const { generateRandomUrl } = require('../auth/guest');
const { Route } = require('../../models');
module.exports = async (req, res) => {
@ -9,6 +10,7 @@ module.exports = async (req, res) => {
if (!exists) return res.send({ success: false, mode: 'not_found_2' });
const data = exists.toObject();
const random_url = await generateRandomUrl();
return res.send({
success: true,
@ -17,7 +19,8 @@ module.exports = async (req, res) => {
owner: {
...data.owner,
id: data.owner._id,
}
},
random_url,
});
};