Skip to content

Commit 2f1fa5c

Browse files
committed
fix: update condition for deleting objects based on publishedAt status
1 parent 22d45c8 commit 2f1fa5c

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎server/src/services/strapi.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default ({ strapi }: { strapi: Core.Strapi }) => ({
6868
[]
6969
);
7070

71-
if (event.action === 'afterUpdate') {
71+
if (strapiObject.publishedAt === null) {
7272
objectsIdsToDelete.push(entryId);
7373
} else {
7474
objectsToSave.push(
@@ -117,8 +117,6 @@ export default ({ strapi }: { strapi: Core.Strapi }) => ({
117117
const objectsToSave: any[] = [];
118118
const objectsIdsToDelete: string[] = [];
119119

120-
//
121-
122120
for (const article of articles) {
123121
try {
124122
const entryId = article.id;

0 commit comments

Comments
 (0)