From 54828682e2c5951332f211d0ed5e96b72da7ca08 Mon Sep 17 00:00:00 2001 From: Jamie Howard Date: Tue, 5 Sep 2023 10:12:08 +0100 Subject: [PATCH] fix(ee): invalidate stages list when stage is changed --- .../InformationBox/components/StageSelect/StageSelect.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/admin/ee/admin/content-manager/pages/EditView/InformationBox/components/StageSelect/StageSelect.js b/packages/core/admin/ee/admin/content-manager/pages/EditView/InformationBox/components/StageSelect/StageSelect.js index 28f44cf5c8..0898c88d9c 100644 --- a/packages/core/admin/ee/admin/content-manager/pages/EditView/InformationBox/components/StageSelect/StageSelect.js +++ b/packages/core/admin/ee/admin/content-manager/pages/EditView/InformationBox/components/StageSelect/StageSelect.js @@ -17,7 +17,7 @@ import { useNotification, } from '@strapi/helper-plugin'; import { useIntl } from 'react-intl'; -import { useMutation } from 'react-query'; +import { useMutation, useQueryClient } from 'react-query'; import { useLicenseLimits } from '../../../../../../hooks/useLicenseLimits'; import * as LimitsModal from '../../../../../../pages/SettingsPage/pages/ReviewWorkflows/components/LimitsModal'; @@ -32,6 +32,7 @@ import { STAGE_ATTRIBUTE_NAME } from '../../constants'; export function StageSelect() { const { initialData, layout: contentType, isSingleType, onChange } = useCMEditViewDataManager(); const { put } = useFetchClient(); + const queryClient = useQueryClient(); const { formatMessage } = useIntl(); const { formatAPIError } = useAPIErrorHandler(); const toggleNotification = useNotification(); @@ -67,6 +68,8 @@ export function StageSelect() { true ); + queryClient.invalidateQueries(['content-manager', typeSlug, uid, entityId, 'stages']); + return createdEntity; }, {