Files
e-tib.com/scripts/check-today-submissions.ts
Marc Mintel 26d325df44
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 38s
Build & Deploy / 🧪 QA (push) Successful in 1m22s
Build & Deploy / 🏗️ Build (push) Successful in 4m27s
Build & Deploy / 🚀 Deploy (push) Failing after 39s
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
fix(config): ensure analytics URL has protocol to prevent build crash
2026-05-12 13:01:18 +02:00

30 lines
882 B
TypeScript

import { Client } from 'pg';
async function checkSubmissions() {
const client = new Client({
connectionString: "postgresql://payload:120in09oenaoinsd9iaidon@127.0.0.1:54322/payload"
});
try {
await client.connect();
console.log("Connected to database.");
const res = await client.query("SELECT * FROM form_submissions WHERE created_at >= '2026-04-12' ORDER BY created_at DESC;");
if (res.rows.length === 0) {
console.log("No submissions found for today.");
} else {
console.log(`Found ${res.rows.length} submissions for today:`);
res.rows.forEach(row => {
console.log(`- [${row.created_at}] ${row.name} (${row.email}): ${row.message.substring(0, 50)}...`);
});
}
} catch (err) {
console.error("Database query failed:", err.message);
} finally {
await client.end();
}
}
checkSubmissions();