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 da76bb1 commit f38a1cfCopy full SHA for f38a1cf
services/feedback/feedback.hooks.ts
@@ -1,9 +1,27 @@
1
+import { populate, discard } from 'feathers-hooks-common';
2
import requireAuth from '../../hooks/requireAuth';
3
import signAuthority from '../../hooks/signAuthority';
4
+import sortByDate from '../../hooks/sortByDate';
5
+
6
7
+const populateAuthor = populate({
8
+ schema: {
9
+ include: {
10
+ service: 'users',
11
+ nameAs: 'author',
12
+ parentField: 'authorId',
13
+ childField: '_id'
14
+ }
15
16
+});
17
18
export default {
19
before: {
- create: [requireAuth, signAuthority]
20
+ create: [requireAuth, signAuthority],
21
+ find: sortByDate
22
+ },
23
+ after: {
24
+ all: [populateAuthor, discard('authorId')]
25
}
26
};
27
0 commit comments