feat: harden content workflows and staging smoke tests
CI — Test & Build / 🧪 Run Tests & Generate Reports (push) Waiting to run
CI — Test & Build / 🏗️ Build Docker Image (push) Blocked by required conditions
CI — Test & Build / 🐳 Docker integration & API E2E (push) Blocked by required conditions
CI — Test & Build / 🌐 Staging Playwright smoke (push) Waiting to run

This commit is contained in:
Do Siki
2026-08-17 16:08:57 +02:00
parent 35e341d5b2
commit 0047e1b441
28 changed files with 1208 additions and 360 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
import { MongoClient, Db } from 'mongodb'
import { MongoClient, Db, Collection, Document } from 'mongodb'
if (!process.env.MONGODB_URI) {
throw new Error('Please add MONGODB_URI to your environment variables')
@@ -37,9 +37,9 @@ export async function getDb(): Promise<Db> {
return client.db(process.env.MONGODB_DB || 'mozdit')
}
export async function getCollection(collectionName: string) {
export async function getCollection<T extends Document = Document>(collectionName: string): Promise<Collection<T>> {
const db = await getDb()
return db.collection(collectionName)
return db.collection<T>(collectionName)
}
// Health check for MongoDB connection
@@ -52,4 +52,4 @@ export async function checkMongoConnection(): Promise<boolean> {
console.error('MongoDB connection check failed:', error)
return false
}
}
}