- Create Economist SubmissionTracking package correctly: * mainArticle = full blog post content * coverLetter = 216-word SIR— letter * Links to blog post via blogPostId - Archive 'Letter to The Economist' from blog posts (it's the cover letter) - Fix date display on article cards (use published_at) - Target publication already displaying via blue badge Database changes: - Make blogPostId optional in SubmissionTracking model - Economist package ID: 68fa85ae49d4900e7f2ecd83 - Le Monde package ID: 68fa2abd2e6acd5691932150 Next: Enhanced modal with tabs, validation, export 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
49 lines
1.5 KiB
JavaScript
49 lines
1.5 KiB
JavaScript
const mongoose = require('mongoose');
|
|
require('dotenv').config();
|
|
|
|
const BlogPost = require('../src/models/BlogPost.model');
|
|
|
|
async function manageArticles() {
|
|
try {
|
|
await mongoose.connect(process.env.MONGODB_URI || 'mongodb://localhost:27017/tractatus_dev');
|
|
console.log('Connected to MongoDB\n');
|
|
|
|
// Find all pending review articles
|
|
const pendingArticles = await BlogPost.find({ status: 'pending_review' });
|
|
|
|
console.log('=== PENDING REVIEW ARTICLES ===\n');
|
|
pendingArticles.forEach((article, idx) => {
|
|
console.log((idx + 1) + '. ' + article.title);
|
|
console.log(' ID: ' + article._id);
|
|
console.log(' Created: ' + article.createdAt);
|
|
console.log(' Target Publication: ' + (article.targetPublication || 'Not set'));
|
|
console.log('');
|
|
});
|
|
|
|
// Find Economist article
|
|
const economistArticle = await BlogPost.findOne({
|
|
title: /economist.*strategy/i
|
|
});
|
|
|
|
if (economistArticle) {
|
|
console.log('=== FOUND ECONOMIST ARTICLE ===');
|
|
console.log('Title: ' + economistArticle.title);
|
|
console.log('Status: ' + economistArticle.status);
|
|
console.log('ID: ' + economistArticle._id + '\n');
|
|
|
|
// Change to draft instead of deleting
|
|
economistArticle.status = 'draft';
|
|
await economistArticle.save();
|
|
console.log('✓ Changed status to draft\n');
|
|
} else {
|
|
console.log('No Economist article found\n');
|
|
}
|
|
|
|
await mongoose.connection.close();
|
|
} catch (error) {
|
|
console.error('Error:', error);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
manageArticles();
|