Commit f6cfef89 authored by mntmn's avatar mntmn Committed by mntmn
Browse files

allow looking up spaces via slug

parent b99ec300
'use strict';
const db = require('../models/db');
const { Op } = require("sequelize");
var config = require('config');
module.exports = (req, res, next) => {
......@@ -53,8 +54,12 @@ module.exports = (req, res, next) => {
'email': 1
};
// find space by id or slug
db.Space.findOne({where: {
"_id": spaceId
[Op.or]: [
{"_id": spaceId},
{"edit_slug": spaceId}
]
}}).then(function(space) {
if (space) {
......
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