Skip to content

Commit

Permalink
fix: Remove partialIndex with variable
Browse files Browse the repository at this point in the history
  • Loading branch information
zatteo committed Nov 5, 2024
1 parent 0d5c51d commit 829fdfc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
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

0 comments on commit 829fdfc

Please sign in to comment.