mirror of
https://github.com/strapi/strapi.git
synced 2025-11-11 15:49:50 +00:00
fix(content-manager): send locale when deleting i18n single type (#19629)
This commit is contained in:
parent
b6d552f6e6
commit
030161746a
@ -88,7 +88,13 @@ const ContentTypeFormWrapper = ({
|
|||||||
const { setCurrentStep } = useGuidedTour();
|
const { setCurrentStep } = useGuidedTour();
|
||||||
const { trackUsage } = useTracking();
|
const { trackUsage } = useTracking();
|
||||||
const { push, replace } = useHistory();
|
const { push, replace } = useHistory();
|
||||||
const [{ query, rawQuery }] = useQueryParams();
|
const [{ query, rawQuery }] = useQueryParams<{
|
||||||
|
plugins?: {
|
||||||
|
i18n?: {
|
||||||
|
locale?: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}>();
|
||||||
const dispatch = useTypedDispatch();
|
const dispatch = useTypedDispatch();
|
||||||
const { componentsDataStructure, contentTypeDataStructure, data, isLoading, status } =
|
const { componentsDataStructure, contentTypeDataStructure, data, isLoading, status } =
|
||||||
useTypedSelector((state) => state['content-manager_editViewCrudReducer']);
|
useTypedSelector((state) => state['content-manager_editViewCrudReducer']);
|
||||||
@ -252,8 +258,12 @@ const ContentTypeFormWrapper = ({
|
|||||||
try {
|
try {
|
||||||
trackUsage('willDeleteEntry', trackerProperty);
|
trackUsage('willDeleteEntry', trackerProperty);
|
||||||
|
|
||||||
|
const locale = query?.plugins?.i18n?.locale;
|
||||||
|
const params = isSingleType && locale ? { locale } : {};
|
||||||
|
|
||||||
const { data } = await del<Contracts.CollectionTypes.Delete.Response>(
|
const { data } = await del<Contracts.CollectionTypes.Delete.Response>(
|
||||||
`/content-manager/${collectionType}/${slug}/${id}`
|
`/content-manager/${collectionType}/${slug}/${id}`,
|
||||||
|
{ params }
|
||||||
);
|
);
|
||||||
|
|
||||||
toggleNotification({
|
toggleNotification({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user