This repository was archived by the owner on Jun 27, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +48
-21
lines changed Expand file tree Collapse file tree 8 files changed +48
-21
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ module.exports = function () {
12
12
require ( './candos' ) ,
13
13
require ( './users-candos' ) ,
14
14
require ( './projects' ) ,
15
- // require('./follows'),
15
+ require ( './follows' ) ,
16
16
require ( './comments' ) ,
17
17
require ( './emotions' ) ,
18
18
require ( './invites' ) ,
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ const userSchema = {
21
21
service : 'users' ,
22
22
nameAs : 'user' ,
23
23
parentField : 'userId' ,
24
- childField : '_id'
24
+ childField : '_id' ,
25
+ query : {
26
+ $limit : 1
27
+ }
25
28
}
26
29
} ;
27
30
Original file line number Diff line number Diff line change @@ -26,7 +26,10 @@ const userSchema = {
26
26
service : 'users' ,
27
27
nameAs : 'user' ,
28
28
parentField : 'userId' ,
29
- childField : '_id'
29
+ childField : '_id' ,
30
+ query : {
31
+ $limit : 1
32
+ }
30
33
}
31
34
} ;
32
35
Original file line number Diff line number Diff line change @@ -56,19 +56,21 @@ module.exports = function(options = {}) { // eslint-disable-line no-unused-vars
56
56
} ) ;
57
57
putQuery . $inc [ `emotions.${ hook . result . rated } .count` ] += 1 ;
58
58
59
- contributionService . patch ( hook . result . contributionId , putQuery )
60
- . then ( contribution => {
59
+ contributionService . patch (
60
+ hook . result . contributionId ,
61
+ putQuery ,
62
+ { _populate : 'skip' }
63
+ ) . then ( contribution => {
64
+ calculatePercentValues ( contribution ) ;
61
65
62
- calculatePercentValues ( contribution ) ;
63
-
64
- contributionService . patch ( hook . result . contributionId , {
65
- $set : {
66
- emotions : contribution . emotions
67
- }
68
- } ) . then ( ( ) => {
69
- resolve ( hook ) ;
70
- } ) ;
66
+ contributionService . patch ( hook . result . contributionId , {
67
+ $set : {
68
+ emotions : contribution . emotions
69
+ }
70
+ } ) . then ( ( ) => {
71
+ resolve ( hook ) ;
71
72
} ) ;
73
+ } ) ;
72
74
} ) ;
73
75
} ) ;
74
76
} ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const badges = require('./badges/badges.service.js');
12
12
const emotions = require ( './emotions/emotions.service.js' ) ;
13
13
const organizations = require ( './organizations/organizations.service.js' ) ;
14
14
const projects = require ( './projects/projects.service.js' ) ;
15
- // const follows = require('./follows/follows.service.js');
15
+ const follows = require ( './follows/follows.service.js' ) ;
16
16
const shouts = require ( './shouts/shouts.service.js' ) ;
17
17
const admin = require ( './admin/admin.service.js' ) ;
18
18
const invites = require ( './invites/invites.service.js' ) ;
@@ -38,7 +38,7 @@ module.exports = function () {
38
38
app . configure ( emotions ) ;
39
39
app . configure ( organizations ) ;
40
40
app . configure ( projects ) ;
41
- // app.configure(follows);
41
+ app . configure ( follows ) ;
42
42
app . configure ( shouts ) ;
43
43
app . configure ( admin ) ;
44
44
app . configure ( invites ) ;
Original file line number Diff line number Diff line change @@ -13,11 +13,17 @@ const commentSchema = {
13
13
nameAs : 'comment' ,
14
14
parentField : 'relatedCommentId' ,
15
15
childField : '_id' ,
16
+ query : {
17
+ $limit : 1
18
+ } ,
16
19
include : {
17
20
service : 'users' ,
18
21
nameAs : 'user' ,
19
22
parentField : 'userId' ,
20
- childField : '_id'
23
+ childField : '_id' ,
24
+ query : {
25
+ $limit : 1
26
+ }
21
27
}
22
28
}
23
29
} ;
@@ -27,7 +33,10 @@ const contributionSchema = {
27
33
service : 'contributions' ,
28
34
nameAs : 'contribution' ,
29
35
parentField : 'relatedContributionId' ,
30
- childField : '_id'
36
+ childField : '_id' ,
37
+ query : {
38
+ $limit : 1
39
+ }
31
40
}
32
41
} ;
33
42
@@ -36,7 +45,10 @@ const userSchema = {
36
45
service : 'users' ,
37
46
nameAs : 'user' ,
38
47
parentField : 'relatedUserId' ,
39
- childField : '_id'
48
+ childField : '_id' ,
49
+ query : {
50
+ $limit : 1
51
+ }
40
52
}
41
53
} ;
42
54
Original file line number Diff line number Diff line change @@ -32,7 +32,10 @@ const reviewerSchema = {
32
32
service : 'users' ,
33
33
nameAs : 'reviewer' ,
34
34
parentField : 'reviewedBy' ,
35
- childField : '_id'
35
+ childField : '_id' ,
36
+ query : {
37
+ $limit : 1
38
+ }
36
39
}
37
40
} ;
38
41
Original file line number Diff line number Diff line change @@ -58,7 +58,10 @@ const userSettingsPrivateSchema = {
58
58
nameAs : 'userSettings' ,
59
59
parentField : '_id' ,
60
60
childField : 'userId' ,
61
- asArray : false
61
+ asArray : false ,
62
+ query : {
63
+ $limit : 1
64
+ }
62
65
}
63
66
} ;
64
67
@@ -70,6 +73,7 @@ const userSettingsSchema = {
70
73
childField : 'userId' ,
71
74
query : {
72
75
$select : [ 'uiLanguage' , 'contentLanguages' ] ,
76
+ $limit : 1
73
77
} ,
74
78
asArray : false
75
79
}
You can’t perform that action at this time.
0 commit comments