diff --git a/lib/activitypub/articles.ts b/lib/activitypub/articles.ts index 789cf44..33f22a1 100644 --- a/lib/activitypub/articles.ts +++ b/lib/activitypub/articles.ts @@ -9,9 +9,10 @@ const domain = process.env.DOMAIN; export async function setup(posts: Page[]) { const repository = getConnection().getRepository(Article); + const allPosts = await repository.find(); for (const post of posts) { const postMeta = post.metadata; - if (await repository.findOne(postMeta.permalink)) { + if (allPosts.some((p) => p.id === postMeta.permalink)) { continue; } const articleObject = {