diff --git a/backend/app/Jobs/PublishNextArticleJob.php b/backend/app/Jobs/PublishNextArticleJob.php index 6a77eee..1e6dde1 100644 --- a/backend/app/Jobs/PublishNextArticleJob.php +++ b/backend/app/Jobs/PublishNextArticleJob.php @@ -32,9 +32,8 @@ public function handle(): void { // Get the oldest approved article that hasn't been published yet $article = Article::where('approval_status', 'approved') - ->whereNotNull('validated_at') ->whereDoesntHave('articlePublication') - ->oldest('validated_at') + ->oldest('created_at') ->first(); if (! $article) { @@ -45,7 +44,7 @@ public function handle(): void 'article_id' => $article->id, 'title' => $article->title, 'url' => $article->url, - 'validated_at' => $article->validated_at + 'created_at' => $article->created_at ]); // Fetch article data