From fc9cf3b8f77e9068fa51d614b0d0b120f7bf2440 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 25 Jun 2020 09:03:46 +0300 Subject: feat!: construct VoteService based on VoteModel --- services/votes/votes.service.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'services/votes/votes.service.ts') diff --git a/services/votes/votes.service.ts b/services/votes/votes.service.ts index 3947d9b..81f767c 100644 --- a/services/votes/votes.service.ts +++ b/services/votes/votes.service.ts @@ -1,10 +1,13 @@ import { Application } from '@feathersjs/express'; -import Votes from './votes.class'; +import service from 'feathers-mongoose'; +import Model from '../../models/votes/vote.model'; import hooks from './votes.hooks'; +const VoteService = service({ Model }); + export default (app: Application): void => { - app.use('/polls/:id/votes/', new Votes()); - app.service('/polls/:id/votes/').hooks(hooks); + app.use('/votes/', VoteService); + app.service('votes').hooks(hooks); }; -- cgit v1.2.3