File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change
1
+ import { Poll , PollSchema } from "../../models/polls/poll.schema" ;
2
+ import PollModel from '../../models/polls/poll.model' ;
3
+
4
+ export default class Profiles {
5
+ async get ( id : string , params : any ) : Promise < PollSchema [ ] > {
6
+ return PollModel . find ( { authorId : id } ) ;
7
+ }
8
+ } ;
9
+
Original file line number Diff line number Diff line change 1
- import { User } from '../../models/users/user.schema' ;
2
- import { Poll } from "../../models/polls/poll.schema" ;
3
- import { Application } from "@feathersjs/express" ;
4
-
5
- export class ProfileService {
6
- user : User = Object ;
7
- saved_polls : Poll [ ] = [ ] ;
8
-
9
- async find ( ) {
10
- return [ this . user , this . saved_polls ] ;
11
- }
12
- }
1
+ import { Application } from "@feathersjs/express" ;
2
+ import Profiles from './profile.class' ;
13
3
14
4
export default ( app : Application ) : void => {
15
- app . use ( '/profile' , new ProfileService ( ) ) ;
16
- } ;
5
+ app . use ( '/profile' , new Profiles ( ) ) ;
6
+ } ;
7
+
You can’t perform that action at this time.
0 commit comments