Skip to content

Commit 1c184a6

Browse files
authored
Merge pull request #277 from pluginpal/feature/fix-update-issue
fix: pass the locale to the URL alias update request to prevent issues
2 parents 11f4c2e + 7171604 commit 1c184a6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/bumpy-sites-search.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"strapi-plugin-webtools": patch
3+
---
4+
5+
fix: pass the locale to the URL alias update request to prevent issues

packages/core/admin/components/EditForm/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const EditForm = () => {
2929
const urlParams = new URLSearchParams(window.location.search);
3030
const locale = urlParams.get('plugins[i18n][locale]');
3131
const aliases = useQuery(`aliases-${model}-${id}-${locale}`, async () => get<UrlAliasEntity[]>(`/webtools/url-alias/findFrom?model=${model}&documentId=${id}&locale=${locale}`));
32-
const mutation = useMutation((updatedAlias: Partial<UrlAliasEntity>) => put(`/webtools/url-alias/update/${aliases.data.data[0].documentId}`, {
32+
const mutation = useMutation((updatedAlias: Partial<UrlAliasEntity>) => put(`/webtools/url-alias/update/${aliases.data.data[0].documentId}${locale ? `?locale=${locale}` : ''}`, {
3333
data: updatedAlias,
3434
}));
3535

0 commit comments

Comments
 (0)