Skip to content

Commit

Permalink
feat(Assistant): Use new getByIds methods to fetch sources
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Nov 7, 2024
1 parent d143b7e commit ea844d1
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/assistant/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ea844d1

Please sign in to comment.