Skip to content

Commit

Permalink
fix(#9193): make changes to queryDocs function is local/doc.ts accord…
Browse files Browse the repository at this point in the history
…ing to new PouchDB API
  • Loading branch information
sugat009 committed Aug 9, 2024
1 parent b20dc22 commit 710d0a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions shared-libs/cht-datasource/src/local/libs/doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ export const getDocsByIds = (db: PouchDB.Database<Doc>) => async (uuids: string[
.filter((doc): doc is Doc => isDoc(doc));
};

const queryDocs = (db: PouchDB.Database<Doc>, view: string, options: PouchDB.Query.Options<Doc, unknown>) => db
.query(view, {...options})
const queryDocs = (
db: PouchDB.Database<Doc>,
view: string,
options: PouchDB.Query.Options<Doc, Record<string, unknown>>
) => db
.query(view, options)
.then(({ rows }) => rows.map(({ doc }) => isDoc(doc) ? doc : null));

/** @internal */
Expand Down

0 comments on commit 710d0a8

Please sign in to comment.