From 9046cbd66d96f15f47201bc2e6b9e211d85811f5 Mon Sep 17 00:00:00 2001 From: Ysrbolles Date: Wed, 20 Nov 2024 14:48:20 +0100 Subject: [PATCH] fix(partnersReducer, partners.ts): update toggle logic and change base URL for development --- src/helpers/partnersReducer.ts | 4 ++-- src/redux/services/partners.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helpers/partnersReducer.ts b/src/helpers/partnersReducer.ts index ad6d583f..cd873077 100644 --- a/src/helpers/partnersReducer.ts +++ b/src/helpers/partnersReducer.ts @@ -31,7 +31,6 @@ export enum partnersActions { 'TOGGLE_VALIDATORS', 'TOGGLE_ON_MESSENGER', 'UPDATE_BUSINESS_FIELDS_FROM_API', - } export interface ActionType { @@ -88,9 +87,10 @@ export const partnersReducer = ( case partnersActions.TOGGLE_CATEGORY: const updatedBusinessField = state.businessField.map(group => { if (group.category === action.payload) { + const isAllSelected = group.fields.every(field => field.active) const updatedFields = group.fields.map(field => ({ ...field, - active: !field.active, + active: isAllSelected ? false : true, // Toggle between all selected and all deselected })) return { ...group, fields: updatedFields } } diff --git a/src/redux/services/partners.ts b/src/redux/services/partners.ts index 602cbc9c..83dee9c5 100644 --- a/src/redux/services/partners.ts +++ b/src/redux/services/partners.ts @@ -179,7 +179,7 @@ function getServiceName(fullName: unknown): string { const getBaseUrl = () => { const currentPath = typeof window !== 'undefined' ? window.location.hostname : '' if (currentPath === 'localhost' || currentPath.includes('dev')) { - return BASE_URLS.prod + return BASE_URLS.dev } else if (currentPath) { return BASE_URLS.prod } else {