End "project and Todos": what could modify or readonly.

This commit is contained in:
Paolo Arena
2019-04-22 01:43:58 +02:00
parent e0e48f7eb2
commit f3964b0ff0
4 changed files with 39 additions and 21 deletions

View File

@@ -146,7 +146,7 @@ ProjectSchema.statics.findProjectByUserId = function (userId, idproj) {
} else {
return Project.findOne({
'userId': userId,
'_id': ObjectId(idproj),
'_id': idproj,
});
}
};
@@ -156,6 +156,7 @@ ProjectSchema.statics.findAllProjByUserId = async function (userId) {
var Project = this;
return Project.aggregate([
{ $match: { $or: [{ privacyread: server_constants.Privacy.all }, { userId: userId }] } },
{
$graphLookup: {
from: "projects",