feat(admin): implement 4 admin modules schema, migrations, DTOs and controllers with CSV export
Deploy Canina / deploy (push) Successful in 2m25s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 6s

This commit is contained in:
devops committed 2026-10-13 21:18:19 +00:00
1 parent 5e0541c739
commit ff3f819fb6
12 files changed
+1584 -157

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
export function generateCsv(
rows: Record<string, any>[],
columns: { key: string; header: string }[],
): string {
const headerLine = columns
.map((c) => `"${c.header.replace(/"/g, '""')}"`)
.join(",");
const lines = rows.map((row) => {
return columns
.map((c) => {
let val = row[c.key];
if (val === null || val === undefined) {
return '""';
}
if (typeof val === "object") {
if (val instanceof Date) {
val = val.toISOString();
} else {
val = JSON.stringify(val);
}
}
return `"${String(val).replace(/"/g, '""')}"`;
})
.join(",");
});
return "\uFEFF" + [headerLine, ...lines].join("\r\n");
}