mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 10:55:37 +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 { 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({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user