From 39938239a6f58a0266c9a32f35ee6c5ae7c15c5c Mon Sep 17 00:00:00 2001 From: Novak Zaballa <41410593+novakzaballa@users.noreply.github.com> Date: Tue, 14 Nov 2023 14:41:03 -0400 Subject: [PATCH] fix: Update endpoint getEnvironment RTK response (#2968) --- frontend/common/services/useEnvironment.ts | 5 +---- frontend/web/components/SegmentOverrides.js | 2 +- frontend/web/components/modals/AssociatedSegmentOverrides.js | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/frontend/common/services/useEnvironment.ts b/frontend/common/services/useEnvironment.ts index 6330e72cc21f..2a0bd2aaf652 100644 --- a/frontend/common/services/useEnvironment.ts +++ b/frontend/common/services/useEnvironment.ts @@ -46,12 +46,9 @@ export async function getEnvironment( typeof environmentService.endpoints.getEnvironment.initiate >[1], ) { - store.dispatch( + return store.dispatch( environmentService.endpoints.getEnvironment.initiate(data, options), ) - return Promise.all( - store.dispatch(environmentService.util.getRunningQueriesThunk()), - ) } // END OF FUNCTION_EXPORTS diff --git a/frontend/web/components/SegmentOverrides.js b/frontend/web/components/SegmentOverrides.js index 4ec14620bd7e..1787fa346749 100644 --- a/frontend/web/components/SegmentOverrides.js +++ b/frontend/web/components/SegmentOverrides.js @@ -434,7 +434,7 @@ class TheComponent extends Component { id: this.props.environmentId, }).then((res) => { this.setState({ - totalSegmentOverrides: res[0].data.total_segment_overrides, + totalSegmentOverrides: res.data.total_segment_overrides, }) }) } diff --git a/frontend/web/components/modals/AssociatedSegmentOverrides.js b/frontend/web/components/modals/AssociatedSegmentOverrides.js index 32bfb9fa8274..d6088c61924b 100644 --- a/frontend/web/components/modals/AssociatedSegmentOverrides.js +++ b/frontend/web/components/modals/AssociatedSegmentOverrides.js @@ -401,7 +401,7 @@ class SegmentOverridesInnerAdd extends Component { getEnvironment(getStore(), { id }).then((res) => { this.setState({ - totalSegmentOverrides: res[1].data.total_segment_overrides, + totalSegmentOverrides: res.data.total_segment_overrides, }) }) }