Skip to content
Snippets Groups Projects
Commit 669cf237 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix

parent 5e159cb0
No related branches found
No related tags found
2 merge requests!19Feat/us858 save expiration date,!17fix/US846-onDelete
...@@ -23,17 +23,15 @@ async function getAccount(accountId) { ...@@ -23,17 +23,15 @@ async function getAccount(accountId) {
} }
async function getAccountForDelete(accountId, accountRev) { async function getAccountForDelete(accountId, accountRev) {
log('info', `getAccountForDelete: ${accountId}`) log('info', `getAccountForDelete: ${accountId} ${accountRev}`)
const accounts = await cozyClient.data.findAll('io.cozy.accounts') // const accounts = await cozyClient.data.findAll('io.cozy.accounts')
const body = await cozyClient.fetchJSON( const body = await cozyClient.fetchJSON(
'GET', 'GET',
`/data/io.cozy.accounts/${accountId}?rev=${accountRev}` `/data/io.cozy.accounts/${accountId}?rev=${accountRev}`
) )
log('info', `getAccountForDelete: ${body}`) log('info', `getAccountForDelete: ${body}`)
return accounts.filter(account => return body
isLocal() ? account._id === accountId : account.account_type === accountId
)[0]
} }
module.exports = { getAccount, saveAccountData, getAccountForDelete } module.exports = { getAccount, saveAccountData, getAccountForDelete }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment