aboutsummaryrefslogtreecommitdiff
path: root/services/profiles/profiles.class.ts
blob: a6de474f894d9a2cc8c42887fc702fea51034dc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { Application } from '@feathersjs/express';
import { Params } from '@feathersjs/feathers';
import { Poll } from 'which-types';


export default class Profiles {
  app!: Application;

  async get(id: string, params: Params): Promise<Poll[]> {
    return this.app.service('polls').find({
      ...params,
      query: {
        authorId: id
      }
    });
  }

  setup(app: Application): void {
    this.app = app;
  }
}