diff --git a/src/utils/replace-items.ts b/src/utils/replace-items.ts index 8b01541..de0e8e1 100755 --- a/src/utils/replace-items.ts +++ b/src/utils/replace-items.ts @@ -7,7 +7,11 @@ import type { HookContext } from '@feathersjs/feathers'; export function replaceItems(context: H, items: any): void { // @ts-ignore if (context.params && context.params._actOn === 'dispatch') { - context.dispatch = items; + if (context.method === 'find' && context.dispatch?.data) { + context.dispatch.data = Array.isArray(items) ? items : [items]; + } else { + context.dispatch = items; + } return; }