Skip to content

Draft article immediately on schedule deletion#102

Merged
kingRayhan merged 2 commits into
mainfrom
copilot/make-article-drafted-on-schedule-deletion
Apr 2, 2026
Merged

Draft article immediately on schedule deletion#102
kingRayhan merged 2 commits into
mainfrom
copilot/make-article-drafted-on-schedule-deletion

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

When a user schedules an article for deletion, it remained fully published and searchable during the 7-day grace period. It should be removed from public view immediately upon scheduling.

Changes

  • scheduleArticleDelete: now sets published_at = null (drafts the article) and calls deleteArticleById to evict it from the MeiliSearch index at the moment of scheduling — not just at final cleanup time
  • DashboardArticleList optimistic update: also sets published_at: null so the UI instantly reflects the Draft badge when deletion is scheduled
  • restoreShceduleDeletedArticle: unchanged — only clears delete_scheduled_at; the article stays a draft and the author must re-publish manually
// scheduleArticleDelete — before
data: { delete_scheduled_at: addDays(new Date(), 7) }

// scheduleArticleDelete — after
data: { delete_scheduled_at: addDays(new Date(), 7), published_at: null }
// + deleteArticleById(article_id)  ← removes from search index immediately

Copilot AI changed the title [WIP] Fix article draft status during schedule deletion Draft article immediately on schedule deletion Apr 2, 2026
Copilot AI requested a review from kingRayhan April 2, 2026 20:26
@kingRayhan kingRayhan marked this pull request as ready for review April 2, 2026 20:28
@kingRayhan kingRayhan merged commit 45a04c3 into main Apr 2, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 500cf34f-d51e-43fc-a99d-3e533ca2e429

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch copilot/make-article-drafted-on-schedule-deletion

Comment @coderabbitai help to get the list of available commands and usage tips.

@kingRayhan kingRayhan deleted the copilot/make-article-drafted-on-schedule-deletion branch April 2, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make article article drafted during schedule deletion

2 participants