Skip to content

Commit 4a4cfc1

Browse files
committed
refactor(cozy-harvest-lib): Remove dead code
`withKonnectorModal()`, `getUserConfig()` and `updateUserConfig()` seem not to be used anywhere So this commit removes them to simplify the code All those three methods where detected to be dead code because they are related to the `createTemporaryToken` investigation done in #1888 Some other dead code may remain
1 parent 90e711a commit 4a4cfc1

File tree

4 files changed

+0
-117
lines changed

4 files changed

+0
-117
lines changed

packages/cozy-harvest-lib/src/components/hoc/withKonnectorModal.jsx

-74
This file was deleted.

packages/cozy-harvest-lib/src/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import TriggerManagerWithoutLocales, {
77
} from './components/TriggerManager'
88
import FlowProviderWithLocales from './components/FlowProvider'
99
import RoutesWithoutLocales from './components/Routes'
10-
import withKonnectorModalWithoutLocales from './components/hoc/withKonnectorModal'
1110
import KonnectorSuggestionModalWithoutLocales from './components/KonnectorSuggestionModal'
1211
import deprecated from './deprecated'
1312

@@ -29,7 +28,6 @@ import { FlowProvider } from "cozy-harvest-lib"
2928
`
3029
)(FlowProvider)
3130
export const Routes = withLocales(RoutesWithoutLocales)
32-
export const withKonnectorModal = withLocales(withKonnectorModalWithoutLocales)
3331
export const KonnectorSuggestionModal = withLocales(
3432
KonnectorSuggestionModalWithoutLocales
3533
)

packages/cozy-harvest-lib/src/services/bi-http.js

-14
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,6 @@ const encodeToForm = rawForm => {
7878
return formData
7979
}
8080

81-
export const getBIUserConfig = async (config, biAccessToken) => {
82-
return await biRequest('GET', '/users/me/config', config, null, biAccessToken)
83-
}
84-
85-
export const updateBIUserConfig = async (config, userConfig, biAccessToken) => {
86-
return await biRequest(
87-
'POST',
88-
'/users/me/config',
89-
config,
90-
encodeToForm(userConfig),
91-
biAccessToken
92-
)
93-
}
94-
9581
/**
9682
* Get a bi connection given it's id
9783
*

packages/cozy-harvest-lib/src/services/budget-insight.js

-27
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import {
1818
getBIConnection,
1919
createBIConnection,
2020
updateBIConnection,
21-
getBIUserConfig,
22-
updateBIUserConfig,
2321
setBIConnectionSyncStatus
2422
} from './bi-http'
2523
import assert from '../assert'
@@ -450,31 +448,6 @@ export const setSync = async ({
450448
)
451449
}
452450

453-
export const getUserConfig = async ({ client, konnector, account }) => {
454-
const { code: temporaryToken, ...config } = await createTemporaryToken({
455-
client,
456-
konnector,
457-
account
458-
})
459-
const data = await getBIUserConfig(config, temporaryToken)
460-
return data
461-
}
462-
463-
export const updateUserConfig = async ({
464-
client,
465-
konnector,
466-
userConfig,
467-
account
468-
}) => {
469-
const { code: temporaryToken, ...config } = await createTemporaryToken({
470-
client,
471-
konnector,
472-
account
473-
})
474-
const data = await updateBIUserConfig(config, userConfig, temporaryToken)
475-
return data
476-
}
477-
478451
export const getCozyBankId = ({ konnector, account }) => {
479452
const cozyBankId =
480453
get(konnector, 'parameters.bankId') || get(account, 'auth.bankId')

0 commit comments

Comments
 (0)