diff options
Diffstat (limited to 'services/feed/feed.class.ts')
-rw-r--r-- | services/feed/feed.class.ts | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/services/feed/feed.class.ts b/services/feed/feed.class.ts index 8c7cd0b..3a2ffe4 100644 --- a/services/feed/feed.class.ts +++ b/services/feed/feed.class.ts @@ -1,23 +1,13 @@ -import _ from 'lodash'; import { Application } from '@feathersjs/express'; import { Params } from '@feathersjs/feathers'; import { Poll } from 'which-types'; -import { PollSchema } from '../../models/polls/poll.schema'; -import PollModel from '../../models/polls/poll.model'; - export default class Feed { app!: Application; async find(params: Params): Promise<Poll[]> { - return this.app.service('polls') - .find(params) - .then( // Move new verified polls on top - (polls: Poll[]) => _.sortBy(polls, poll => poll.author.verified && !poll.userChoice) - ).then( // But all seen posts go down - (polls: Poll[]) => _.sortBy(polls, poll => !!poll.userChoice) - ); + return this.app.service('polls').find(params); } setup (app: Application) { |