From 7171604a970295ca50416fb62bcd05f7e7f089fd Mon Sep 17 00:00:00 2001 From: Boaz Poolman Date: Sun, 22 Jun 2025 12:59:07 +0200 Subject: [PATCH] fix: pass the locale to the URL alias update request to prevent issues --- .changeset/bumpy-sites-search.md | 5 +++++ packages/core/admin/components/EditForm/index.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/bumpy-sites-search.md diff --git a/.changeset/bumpy-sites-search.md b/.changeset/bumpy-sites-search.md new file mode 100644 index 00000000..cd8893b8 --- /dev/null +++ b/.changeset/bumpy-sites-search.md @@ -0,0 +1,5 @@ +--- +"strapi-plugin-webtools": patch +--- + +fix: pass the locale to the URL alias update request to prevent issues diff --git a/packages/core/admin/components/EditForm/index.tsx b/packages/core/admin/components/EditForm/index.tsx index 2d5f2574..76159752 100644 --- a/packages/core/admin/components/EditForm/index.tsx +++ b/packages/core/admin/components/EditForm/index.tsx @@ -29,7 +29,7 @@ const EditForm = () => { const urlParams = new URLSearchParams(window.location.search); const locale = urlParams.get('plugins[i18n][locale]'); const aliases = useQuery(`aliases-${model}-${id}-${locale}`, async () => get(`/webtools/url-alias/findFrom?model=${model}&documentId=${id}&locale=${locale}`)); - const mutation = useMutation((updatedAlias: Partial) => put(`/webtools/url-alias/update/${aliases.data.data[0].documentId}`, { + const mutation = useMutation((updatedAlias: Partial) => put(`/webtools/url-alias/update/${aliases.data.data[0].documentId}${locale ? `?locale=${locale}` : ''}`, { data: updatedAlias, }));