File tree Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 1
- import { PollSchema } from '../../models/polls/poll.schema' ;
2
- import PollModel from '../../models/polls/poll.model' ;
1
+ import { Application } from '@feathersjs/express' ;
2
+ import { Poll } from 'which-types' ;
3
+
3
4
4
5
export default class Profiles {
5
- async get ( id : string ) : Promise < PollSchema [ ] > {
6
- return PollModel . find ( { authorId : id } ) . lean ( ) ;
6
+ app ! : Application ;
7
+
8
+ async get ( id : string ) : Promise < Poll [ ] > {
9
+ return this . app . service ( 'polls' ) . find ( {
10
+ query : {
11
+ authorId : id
12
+ }
13
+ } ) ;
14
+ }
15
+
16
+ setup ( app : Application ) {
17
+ this . app = app ;
7
18
}
8
19
}
9
20
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
import { Application } from '@feathersjs/express' ;
2
2
import Profiles from './profiles.class' ;
3
3
4
- import hooks from './profiles.hooks' ;
5
-
6
4
export default ( app : Application ) : void => {
7
5
app . use ( '/profiles' , new Profiles ( ) ) ;
8
- app . service ( 'profiles' ) . hooks ( hooks ) ;
9
6
} ;
10
7
You can’t perform that action at this time.
0 commit comments