-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assistant: Add sources #2225
Assistant: Add sources #2225
Conversation
BundleMonFiles updated (4)
Unchanged files (9)
Total files change +3.08KB +0.09% Final result: ✅ View report in BundleMon website ➡️ |
const folderByIds = buildFilesByIds(folderIds) | ||
const { data: folders, ...queryResult } = useQuery( | ||
folderByIds.definition, | ||
folderByIds.options | ||
) | ||
|
||
const isLoading = isQueryLoading(queryResult) | ||
|
||
if (isLoading) return null | ||
|
||
const foldersById = keyBy(folders, '_id') | ||
|
||
const filesWitPath = files.map(file => ({ | ||
...file, | ||
path: foldersById[file.dir_id].path | ||
})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get this part, isn't the path
already present in io.cozy.files
that have the type file
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non justement c'est bien le souci, le path n'est que sur les folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On en discute demain mais je t'ai induit en erreur @JF-Cozy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
à la récupération des io.cozy.files
, un .getByIds(ids)
ne retourne pas le path
, là où un .where({ _id: { $in: ids } })
retourne bien le path
. J'ai donc changé la requête en conséquence et simplifié le code. Cette requête est sous-optimale et ne devrait pas être utilisé, on fait comme ça le temps d'apporter un fix à cozy-client ou la stack afin de récupérer le path
via .getByIds(ids)
5c820ae
to
4b5981f
Compare
4b5981f
to
01559af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
01559af
to
027384e
Compare
No description provided.