Skip to content

Commit

Permalink
Merge branch 'master' into ideas-highly
Browse files Browse the repository at this point in the history
  • Loading branch information
agatatalita authored Mar 31, 2018
2 parents 06df79b + 3273c00 commit d29d488
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 31 deletions.
1 change: 1 addition & 0 deletions controllers/ideas.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,4 @@ async function getIdeasHighlyRated(req, res, next) {


module.exports = { get, getIdeasCommentedBy, getIdeasHighlyRated, getIdeasWithCreators, getIdeasWithMyTags, getIdeasWithTags, getNewIdeas, getRandomIdeas, patch, post };

1 change: 0 additions & 1 deletion controllers/validators/schema/ideas.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,3 @@ const getIdeasHighlyRated = {
};

module.exports = { getIdea, getIdeasCommentedBy, getIdeasHighlyRated, getIdeasWithCreators, getIdeasWithMyTags, getIdeasWithTags, getNewIdeas, getRandomIdeas, patchIdea, postIdeas };

2 changes: 1 addition & 1 deletion models/idea/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class Idea extends Model {
FILTER idea._id == comment.primary
COLLECT i = idea
// sort from newest
SORT i._id DESC, i.created ASC
SORT i.created DESC
LIMIT @offset, @limit
RETURN i`;

Expand Down
30 changes: 1 addition & 29 deletions test/ideas.list.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,22 +552,8 @@ describe('read lists of ideas', () => {
beforeEach(async () => {
const data = {
users: 6,
tags: 6,
verifiedUsers: [0, 1, 2, 3, 4],
ideas: [[{}, 0], [{}, 0],[{}, 1],[{}, 2],[{}, 2],[{}, 2],[{}, 3]],
userTag: [
[0,0,'',5],[0,1,'',4],[0,2,'',3],[0,4,'',1],
[1,1,'',4],[1,3,'',2],
[2,5,'',2]
],
ideaTags: [
[0,0],[0,1],[0,2],
[1,1],[1,2],
[2,1],[2,2],[2,4],
[4,0],[4,1],[4,2],[4,3],[4,4],
[5,2],[5,3],
[6,3]
],
ideaComments: [[0, 0],[0, 1], [0,2],[0,2], [0,4], [1,1], [1,2], [2,1], [2,2], [3,4] ]
};

Expand Down Expand Up @@ -692,23 +678,9 @@ describe('read lists of ideas', () => {
const primarys = 'ideas';
const data = {
users: 6,
tags: 6,
verifiedUsers: [0, 1, 2, 3, 4],
ideas: [[{}, 0], [{}, 0],[{}, 1],[{}, 2],[{}, 2],[{}, 2],[{}, 3]],
userTag: [
[0,0,'',5],[0,1,'',4],[0,2,'',3],[0,4,'',1],
[1,1,'',4],[1,3,'',2],
[2,5,'',2]
],
ideaTags: [
[0,0],[0,1],[0,2],
[1,1],[1,2],
[2,1],[2,2],[2,4],
[4,0],[4,1],[4,2],[4,3],[4,4],
[5,2],[5,3],
[6,3]
],
// odeas with votes: 3:3, 1:3, 5:1, 2:1, 0:0, 6: -1, 4:-2
// ideas with votes: 3:3, 1:3, 5:1, 2:1, 0:0, 6: -1, 4:-2
votes: [
[0, [primarys, 0], -1],
[1, [primarys, 0], 1],
Expand Down

0 comments on commit d29d488

Please sign in to comment.