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 1b9e4c5 commit 26850b5Copy full SHA for 26850b5
src/utils/replace-items.ts
@@ -7,7 +7,11 @@ import type { HookContext } from '@feathersjs/feathers';
7
export function replaceItems<H extends HookContext = HookContext>(context: H, items: any): void {
8
// @ts-ignore
9
if (context.params && context.params._actOn === 'dispatch') {
10
- context.dispatch = items;
+ if (context.method === 'find' && context.dispatch?.data) {
11
+ context.dispatch.data = Array.isArray(items) ? items : [items];
12
+ } else {
13
+ context.dispatch = items;
14
+ }
15
return;
16
}
17
0 commit comments