Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Wolfgang Knopki
Spacedeck-open-SAML
Commits
f6cfef89
Commit
f6cfef89
authored
May 11, 2020
by
mntmn
Committed by
mntmn
May 11, 2020
Browse files
allow looking up spaces via slug
parent
b99ec300
Changes
1
Hide whitespace changes
Inline
Side-by-side
middlewares/space_helpers.js
View file @
f6cfef89
'
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment