Skip to content

Commit 3a3e113

Browse files
committed
fix: use documentId instead of id
1 parent 95a5afc commit 3a3e113

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/core/server/controllers/url-alias.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default factories.createCoreController(contentTypeSlug, ({ strapi }) => (
2727
const contentTypeUrlPartial = contentTypeObj.kind === 'singleType' ? 'single-types' : 'collection-types';
2828

2929
ctx.body = {
30-
link: `/content-manager/${contentTypeUrlPartial}/${contentType}/${entity.id}`,
30+
link: `/content-manager/${contentTypeUrlPartial}/${contentType}/${entity.documentId}`,
3131
};
3232
},
3333
generate: async (

packages/core/server/services/bulk-generate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ const createLanguageLinksForUrlAliases = async () => {
4040
// @ts-ignore
4141
const localizations = relatedEntity.localizations as Array<{
4242
url_alias: {
43-
id: number
43+
documentId: number
4444
},
4545
}>;
4646

4747
const urlAliasLocalizations = localizations
48-
?.map((loc) => loc.url_alias?.id)
48+
?.map((loc) => loc.url_alias?.documentId)
4949
?.filter((loc) => loc) || [];
5050

5151
/**
@@ -155,7 +155,7 @@ const generateUrlAliases = async (params: GenerateParams): Promise<number> => {
155155
documentId: entity.documentId,
156156
data: {
157157
// @ts-ignore
158-
url_alias: newUrlAlias.id,
158+
url_alias: newUrlAlias.documentId,
159159
},
160160
});
161161

0 commit comments

Comments
 (0)