From 8bc4cb65ee89b9812ec328b9fd074c9445e64733 Mon Sep 17 00:00:00 2001 From: Crash-- Date: Tue, 7 Nov 2023 15:44:51 +0100 Subject: [PATCH] feat: Pass the intentData & intentId to the Harvest Route --- src/targets/intents/HarvestRoute.jsx | 4 +++- src/targets/intents/index.jsx | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/targets/intents/HarvestRoute.jsx b/src/targets/intents/HarvestRoute.jsx index 6da7415ebe..91860b5203 100644 --- a/src/targets/intents/HarvestRoute.jsx +++ b/src/targets/intents/HarvestRoute.jsx @@ -6,7 +6,7 @@ import { useClient } from 'cozy-client' import Intents from 'cozy-interapp' import datacardOptions from 'cozy-harvest-lib/dist/datacards/datacardOptions' -export const HarvestRoutes = () => { +export const HarvestRoutes = ({ intentData, intentId }) => { const { konnectorSlug } = useParams() const client = useClient() @@ -27,6 +27,8 @@ export const HarvestRoutes = () => { konnectorSlug={konnectorSlug} onDismiss={() => (service ? service.cancel() : undefined)} datacardOptions={datacardOptions} + intentData={intentData} + intentId={intentId} /> ) diff --git a/src/targets/intents/index.jsx b/src/targets/intents/index.jsx index 06ebda7efe..a136c09a7c 100644 --- a/src/targets/intents/index.jsx +++ b/src/targets/intents/index.jsx @@ -13,6 +13,8 @@ document.addEventListener('DOMContentLoaded', () => { const container = document.querySelector('[role=application]') const root = createRoot(container) // + const params = new URL(document.location).searchParams + const intentId = params.get('intent') root.render( @@ -20,7 +22,12 @@ document.addEventListener('DOMContentLoaded', () => { {({ data }) => ( } /> - } /> + + } + /> )}