mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
map_list: initial
urls: editing now handled through urls
This commit is contained in:
parent
3771e5d338
commit
0d9bad9095
23 changed files with 386 additions and 68 deletions
|
@ -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' }
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue