refactor on components and delete clear, profesional login
This commit is contained in:
@@ -799,21 +799,6 @@ export async function updateArticleFavorite(platform, id, is_favorite, username)
|
||||
}
|
||||
}
|
||||
|
||||
export async function clearAllArticles() {
|
||||
if (!db) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
const articlesCollection = db.collection('articles');
|
||||
const result = await articlesCollection.deleteMany({});
|
||||
return result.deletedCount;
|
||||
} catch (error) {
|
||||
console.error('Error limpiando artículos:', error.message);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Cerrar conexión
|
||||
export async function closeMongoDB() {
|
||||
if (mongoClient) {
|
||||
|
||||
Reference in New Issue
Block a user