fix loading space that user is member of
This commit is contained in:
parent
bdb2e9fde5
commit
01a6bec80e
@ -285,14 +285,14 @@ module.exports = {
|
|||||||
} else {
|
} else {
|
||||||
var findMembershipsForSpace = function(space, allMemberships, prevRole) {
|
var findMembershipsForSpace = function(space, allMemberships, prevRole) {
|
||||||
Membership.findAll({ where: {
|
Membership.findAll({ where: {
|
||||||
"space": space._id
|
"space_id": space._id
|
||||||
}}).then(function(parentMemberships) {
|
}}).then(function(parentMemberships) {
|
||||||
var currentMemberships = parentMemberships.concat(allMemberships);
|
var currentMemberships = parentMemberships.concat(allMemberships);
|
||||||
|
|
||||||
if (space.parent_space_id) {
|
if (space.parent_space_id) {
|
||||||
Space.findOne({ where: {
|
Space.findOne({ where: {
|
||||||
"_id": space.parent_space_id
|
"_id": space.parent_space_id
|
||||||
}}, function(err, parentSpace) {
|
}}).then(function(parentSpace) {
|
||||||
findMembershipsForSpace(parentSpace, currentMemberships, prevRole);
|
findMembershipsForSpace(parentSpace, currentMemberships, prevRole);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user