Compare commits

..

3 Commits

Author SHA1 Message Date
d77dc205dc Merge pull request 'feat: CRUD UI — race form, detail fields, edit/delete actions' (#10) from feat/phase3-crud-ui into main
Some checks failed
CI / build-and-test (push) Has been cancelled
Reviewed-on: #10
2026-04-07 15:38:14 +00:00
8a7e87385a Merge pull request 'docs: fix README dev/production commands, update FRONTEND_PLAN status, remove broken links' (#9) from docs/phase2-fix-documentation into main
Some checks failed
CI / build-and-test (push) Has been cancelled
Reviewed-on: #9
2026-04-07 15:37:41 +00:00
b92fad6939 Merge pull request 'fix: phase 1 bugs — CSS tokens, pluralization, error handling, cross-platform tests' (#8) from fix/phase1-bugs-and-critical-fixes into main
Some checks failed
CI / build-and-test (push) Has been cancelled
Reviewed-on: #8
2026-04-07 15:37:11 +00:00
3 changed files with 8 additions and 14 deletions

View File

@@ -15,7 +15,7 @@ const poolConfig: PoolConfig = {
function mockRowFromInsert(sql: string, params: unknown[]): RaceRow {
const match = sql.match(/INSERT INTO races\s*\(([^)]+)\)\s*VALUES/i);
const now = new Date();
const now = new Date().toISOString();
if (!match) {
return {
id: String(params[0] ?? ""),
@@ -108,7 +108,7 @@ function createMockPool(): Pool {
if (!existing) {
return emptyResult();
}
const updated = { ...existing, updated_at: new Date() };
const updated = { ...existing, updated_at: new Date().toISOString() };
store.set(id, updated);
return {
rows: [updated as unknown as T],

View File

@@ -1,7 +1,4 @@
/**
* Row shape returned by PostgreSQL (snake_case).
* pg returns DATE as string, NUMERIC as string, TIMESTAMPTZ as Date.
*/
/** Row shape returned by PostgreSQL (snake_case). */
export interface RaceRow {
id: string;
race_date: string;
@@ -16,8 +13,8 @@ export interface RaceRow {
finish_time: string | null;
finish_place: string | null;
notes: string | null;
created_at: Date;
updated_at: Date | null;
created_at: string;
updated_at: string | null;
}
/** API shape (camelCase). */
@@ -39,10 +36,6 @@ export interface RaceDto {
updatedAt: string | null;
}
function toISOString(value: Date | string): string {
return value instanceof Date ? value.toISOString() : String(value);
}
/** Convert a DB row to the API DTO (camelCase). */
export function rowToDto(row: RaceRow): RaceDto {
return {
@@ -59,8 +52,8 @@ export function rowToDto(row: RaceRow): RaceDto {
finishTime: row.finish_time,
finishPlace: row.finish_place,
notes: row.notes,
createdAt: toISOString(row.created_at),
updatedAt: row.updated_at ? toISOString(row.updated_at) : null,
createdAt: row.created_at,
updatedAt: row.updated_at,
};
}

View File

@@ -0,0 +1 @@
export {};