mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-11 17:26:32 +02:00
feat: add pg-ff-client to replace HTTP API calls with direct PostgreSQL bulk queries
This commit is contained in:
1 parent
79bc66f4d5
commit
b337d1ff10
1 file changed
-7
@@ -550,13 +550,6 @@ interface ApiPerfDashboard {
|
||||
* N-1 : même jour de semaine (52 semaines = 364 jours avant hier).
|
||||
*/
|
||||
export async function pgGetDashboardData(): Promise<DashboardData> {
|
||||
try {
|
||||
const sampleResult = await pgNoParallel(sql`SELECT codein, no_id FROM articles LIMIT 5`);
|
||||
require('fs').writeFileSync('c:/GIT/CollectFlow/scripts/db-sample.json', JSON.stringify(sampleResult.rows, null, 2));
|
||||
} catch (e: any) {
|
||||
require('fs').writeFileSync('c:/GIT/CollectFlow/scripts/db-sample.json', JSON.stringify({error: e.message}));
|
||||
}
|
||||
|
||||
const yesterday = new Date();
|
||||
yesterday.setDate(yesterday.getDate() - 1);
|
||||
const dateHier = yesterday.toISOString().split("T")[0];
|
||||
|
||||
Reference in new issue
Block a user