fix(content-manager): send locale when deleting i18n single type (#19629)

This commit is contained in:
Jamie Howard 2024-02-29 08:51:17 +00:00 committed by GitHub
parent b6d552f6e6
commit 030161746a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,7 +88,13 @@ const ContentTypeFormWrapper = ({
const { setCurrentStep } = useGuidedTour();
const { trackUsage } = useTracking();
const { push, replace } = useHistory();
const [{ query, rawQuery }] = useQueryParams();
const [{ query, rawQuery }] = useQueryParams<{
plugins?: {
i18n?: {
locale?: string;
};
};
}>();
const dispatch = useTypedDispatch();
const { componentsDataStructure, contentTypeDataStructure, data, isLoading, status } =
useTypedSelector((state) => state['content-manager_editViewCrudReducer']);
@ -252,8 +258,12 @@ const ContentTypeFormWrapper = ({
try {
trackUsage('willDeleteEntry', trackerProperty);
const locale = query?.plugins?.i18n?.locale;
const params = isSingleType && locale ? { locale } : {};
const { data } = await del<Contracts.CollectionTypes.Delete.Response>(
`/content-manager/${collectionType}/${slug}/${id}`
`/content-manager/${collectionType}/${slug}/${id}`,
{ params }
);
toggleNotification({