Skip to content

Commit 98bc5d9

Browse files
committed
fix: the edit link controller
1 parent 074c490 commit 98bc5d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const contentTypeSlug = 'plugin::webtools.url-alias';
1616
export default factories.createCoreController(contentTypeSlug, ({ strapi }) => ({
1717
editLink: async (ctx: Context) => {
1818
const { path } = ctx.query;
19-
const { entity, contentType } = await getPluginService('url-alias').findRelatedEntity(path as string);
19+
const { entity, contentType } = await getPluginService('url-alias').findRelatedEntity(path as string, { status: 'draft' });
2020

2121
if (!entity) {
2222
ctx.notFound();
@@ -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.documentId}`,
30+
link: `/content-manager/${contentTypeUrlPartial}/${contentType}/${contentTypeObj.kind === 'collectionType' ? entity.documentId : ''}`,
3131
};
3232
},
3333
generate: async (

0 commit comments

Comments
 (0)