From bb4c60bbdd2e63ccd33dcd4033ac1de86de70532 Mon Sep 17 00:00:00 2001 From: Baris Cicek Date: Fri, 17 Feb 2017 15:25:34 +0300 Subject: [PATCH] findOne Optional Fields and Return Single Model PersistedModel findOne passes single object not array, also filter have optional fields. --- loopback/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loopback/index.d.ts b/loopback/index.d.ts index 6712c6ae3a..92d3ab828e 100644 --- a/loopback/index.d.ts +++ b/loopback/index.d.ts @@ -1262,7 +1262,7 @@ declare namespace l { * @param {Array} model First model instance that matches the filter or null if none found */ - static findOne(filter?: {fields: string|any|any[]; include: string|any|any[]; order: string; skip: number; where: any; }, callback?: (err: Error, model: any[]) => void): void; + static findOne(filter?: {fields?: string|any|any[]; include?: string|any|any[]; order?: string; skip?: number; where?: any; }, callback?: (err: Error, model: any) => void): void; /** * Finds one record matching the optional filter object. If not found, creates