Skip to content
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

fix: Remove partialIndex with variable #54

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/hooks/useCurrentAccountFolderLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const useCurrentAccountFolderLink = () => {
accountQuery.options
)

if (!accountResult[0]?._id) {
if (!accountResult?.[0]?._id) {
return
}

Expand All @@ -31,7 +31,7 @@ const useCurrentAccountFolderLink = () => {
triggerQuery.options
)

if (!triggerResult[0]?.message?.folder_to_save) {
if (!triggerResult?.[0]?.message?.folder_to_save) {
return
}

Expand Down
17 changes: 6 additions & 11 deletions src/queries/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,9 @@ export const buildPresenceQuery = sourceAccountIdentifier => ({

export const buildAccountQuery = () => ({
definition: () =>
Q('io.cozy.accounts')
.where({
account_type: 'pronote'
})
.partialIndex({
account_type: 'pronote'
}),
Q('io.cozy.accounts').partialIndex({
account_type: 'pronote'
}),
options: {
as: 'io.cozy.files/account_type/pronote',
fetchPolicy: defaultFetchPolicy
Expand All @@ -146,16 +142,15 @@ export const buildTriggerQuery = accountId => ({
Q('io.cozy.triggers')
.where({
message: {
account: accountId,
konnector: 'pronote'
account: accountId
}
})
.partialIndex({
message: {
account: accountId,
konnector: 'pronote'
}
}),
})
.indexFields(['message.account']),
options: {
as: 'io.cozy.triggers/konnector/pronote/account/' + accountId,
fetchPolicy: defaultFetchPolicy
Expand Down
Loading