Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
enedis_sge_konnector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
enedis_sge_konnector
Commits
a449ac9e
Commit
a449ac9e
authored
2 years ago
by
Hugo SUBTIL
Browse files
Options
Downloads
Patches
Plain Diff
fix: onDelete
parent
aa1d8d13
No related branches found
No related tags found
1 merge request
!12
Feat/donnes tech debut contrat
Pipeline
#40040
failed
2 years ago
Stage: test
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/types/types.js
+1
-1
1 addition, 1 deletion
src/core/types/types.js
src/index.js
+2
-2
2 additions, 2 deletions
src/index.js
src/onDeleteAccount.js
+7
-6
7 additions, 6 deletions
src/onDeleteAccount.js
with
10 additions
and
9 deletions
src/core/types/types.js
+
1
−
1
View file @
a449ac9e
...
...
@@ -38,7 +38,7 @@
* @property {string} postalCode
* @property {string} inseeCode
* @property {string} endDate
* @property {number} [serviceI
d
]
* @property {number} [serviceI
D
]
* @property {number} [ID]
*/
...
...
This diff is collapsed.
Click to expand it.
src/index.js
+
2
−
2
View file @
a449ac9e
...
...
@@ -235,14 +235,14 @@ async function deleteConsent(
boToken
)
{
log
(
'
error
'
,
`Invalid or not found consent for user`
)
if
(
userConsent
.
serviceI
d
)
{
if
(
userConsent
.
serviceI
D
)
{
await
terminateContract
(
baseUrl
,
apiAuthKey
,
sgeLogin
,
contractId
,
pointId
,
userConsent
.
serviceI
d
userConsent
.
serviceI
D
)
await
deleteBoConsent
(
boBaseUrl
,
...
...
This diff is collapsed.
Click to expand it.
src/onDeleteAccount.js
+
7
−
6
View file @
a449ac9e
// @ts-check
const
{
log
,
errors
}
=
require
(
'
cozy-konnector-libs
'
)
const
{
getAccountRev
,
getAccountSecret
}
=
require
(
'
./helpers/account
'
)
const
{
getBoConsent
,
deleteBoConsent
}
=
require
(
'
./requests/bo
'
)
...
...
@@ -26,21 +27,21 @@ async function onDeleteAccount() {
accountData
.
data
.
consentId
)
if
(
userConsent
.
pointI
d
&&
userConsent
.
pointI
d
)
{
log
(
'
error
'
,
`Consent found for user`
)
if
(
userConsent
.
serviceI
d
)
{
if
(
userConsent
.
ID
&&
userConsent
.
pointI
D
&&
userConsent
.
pointI
D
)
{
log
(
'
log
'
,
`Consent
${
userConsent
.
ID
}
found for user`
)
if
(
userConsent
.
serviceI
D
)
{
await
deleteBoConsent
(
secrets
.
boBaseUrl
,
secrets
.
boToken
,
userConsent
.
id
userConsent
.
ID
)
await
terminateContract
(
secrets
.
baseUrl
,
secrets
.
apiAuthKey
,
secrets
.
sgeLogin
,
secrets
.
contractId
,
userConsent
.
pointI
d
,
userConsent
.
serviceI
d
userConsent
.
pointI
D
,
userConsent
.
serviceI
D
)
}
else
{
log
(
'
error
'
,
`No service id retrieved from BO`
)
...
...
This diff is collapsed.
Click to expand it.
Hugo SUBTIL
@ext.sopra.husubtil
mentioned in commit
280c9110
·
2 years ago
mentioned in commit
280c9110
mentioned in commit 280c9110c97876b88d7ebb3c7c64ff1e974b162f
Toggle commit list
Hugo SUBTIL
@ext.sopra.husubtil
mentioned in commit
7081f136
·
2 years ago
mentioned in commit
7081f136
mentioned in commit 7081f136451f6b95c591ca8b19ea8f6496fc206b
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment