From ea844d1e336446c1ccb105849ccf255e0abf6473 Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Thu, 7 Nov 2024 10:15:50 +0100 Subject: [PATCH] feat(Assistant): Use new getByIds methods to fetch sources --- src/assistant/queries.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/assistant/queries.js b/src/assistant/queries.js index cd88cfb66..cf24beaf1 100644 --- a/src/assistant/queries.js +++ b/src/assistant/queries.js @@ -7,16 +7,9 @@ export const FILES_DOCTYPE = 'io.cozy.files' const defaultFetchPolicy = fetchPolicies.olderThan(86_400_000) // 24 hours -// we don't use getByIds here to get `path` attribute in the result -// this have to be fixed, it's a work in progess -// meanwhile we use this sub-optimal request export const buildFilesByIds = ids => { return { - definition: Q(FILES_DOCTYPE).where({ - _id: { - $in: ids - } - }), + definition: Q(FILES_DOCTYPE).getByIds(ids), options: { as: `${FILES_DOCTYPE}/${ids.join('')}`, fetchPolicy: defaultFetchPolicy