Skip to content

Commit 1b75758

Browse files
authored
fix: use document service instead of entity service (#201)
1 parent f0d2a2c commit 1b75758

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

server/services/publication-service.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ export default ({ strapi }) => ({
1313
const { hooks } = getPluginService('settingsService').get();
1414

1515
// Fetch the entity before publishing
16-
const entity = await strapi.entityService.findOne(uid, entityId, { locale });
16+
const entity = await strapi.documents(uid).findOne({
17+
documentId: entityId,
18+
locale,
19+
});
1720

1821
await hooks.beforePublish({ strapi, uid, entity });
1922

@@ -40,7 +43,10 @@ export default ({ strapi }) => ({
4043
const { hooks } = getPluginService('settingsService').get();
4144

4245
// Fetch the entity before unpublishing
43-
const entity = await strapi.entityService.findOne(uid, entityId, { locale });
46+
const entity = await strapi.documents(uid).findOne({
47+
documentId: entityId,
48+
locale,
49+
});
4450

4551
await hooks.beforeUnpublish({ strapi, uid, entity });
4652

0 commit comments

Comments
 (0)