We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef5666b commit 699be58Copy full SHA for 699be58
services/profiles/profiles.class.ts
@@ -1,16 +1,20 @@
1
import { Application } from '@feathersjs/express';
2
import { Params } from '@feathersjs/feathers';
3
-import { Poll } from 'which-types';
+import { Poll, User } from 'which-types';
4
5
6
export default class Profiles {
7
app!: Application;
8
9
- async get(id: string, params: Params): Promise<Poll[]> {
+ async get(username: string, params: Params): Promise<Poll[]> {
10
+ const profileUser = await this.app.service('users').find({
11
+ query: { username }
12
+ }).then((results: User[]) => results[0]);
13
+
14
return this.app.service('polls').find({
15
...params,
16
query: {
- authorId: id
17
+ authorId: profileUser._id
18
}
19
});
20
0 commit comments