From 7d08fd6ac3bef5599da606f537b9c418c98a2a2e Mon Sep 17 00:00:00 2001 From: rob Date: Thu, 28 May 2020 13:46:42 -0500 Subject: [PATCH 1/2] add find overloads --- packages/feathers/index.d.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/feathers/index.d.ts b/packages/feathers/index.d.ts index 33c1eda184..1e90c6acbb 100644 --- a/packages/feathers/index.d.ts +++ b/packages/feathers/index.d.ts @@ -205,6 +205,22 @@ declare namespace createApplication { } interface ServiceOverloads { + /** + * Retrieve all resources from this service. + * + * @param params - Service call parameters {@link Params} + * @see {@link https://docs.feathersjs.com/api/services.html#find-params|Feathers API Documentation: .find(params)} + */ + find? (params: Params & { paginate: false}): Promise + + /** + * Retrieve all resources from this service. + * + * @param params - Service call parameters {@link Params} + * @see {@link https://docs.feathersjs.com/api/services.html#find-params|Feathers API Documentation: .find(params)} + */ + find? (params?: Params): Promise> + /** * Create a new resource for this service. * From deb135f5954652a8115a7cad00482de42fb7d828 Mon Sep 17 00:00:00 2001 From: rob Date: Thu, 28 May 2020 14:35:55 -0500 Subject: [PATCH 2/2] fix result check --- packages/authentication-oauth/src/strategy.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/authentication-oauth/src/strategy.ts b/packages/authentication-oauth/src/strategy.ts index 1a2358872f..86bdef0b63 100644 --- a/packages/authentication-oauth/src/strategy.ts +++ b/packages/authentication-oauth/src/strategy.ts @@ -103,7 +103,8 @@ export class OAuthStrategy extends AuthenticationBaseStrategy { ...params, query }); - const [ entity = null ] = result.data ? result.data : result; + + const [ entity = null ] = Array.isArray(result) ? result : result.data debug('findEntity returning', entity);