feat(deploy): image web Docker et docker-compose complet (P5)
- Dockerfile multi-étapes (node:22-alpine, pnpm, output standalone), .dockerignore - docker-compose : service web (hôte 4000) + mysql + mongo avec volumes nommés - Env de connexion selon DB_IMPL (MYSQL_*, MONGODB_URI) ; mongo ?authSource=admin - Seed MySQL via 02-seed.sh (--default-character-set=utf8mb4) pour un UTF-8 propre - fix(api): parseTags gère les colonnes JSON déjà parsées par mysql2 - TODO : phase 5 et DoD cochées
This commit is contained in:
1 parent
17ae195b39
commit
f165168608
9 files changed
+112
-20
No files matched your search
@@ -29,13 +29,28 @@ export class MysqlCardRepository implements CardRepository {
|
||||
})
|
||||
}
|
||||
|
||||
private parseTags(value: string | unknown): string[] {
|
||||
if (Array.isArray(value)) {
|
||||
return value as string[]
|
||||
}
|
||||
if (typeof value === 'string') {
|
||||
try {
|
||||
const parsed = JSON.parse(value)
|
||||
return Array.isArray(parsed) ? parsed : []
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
private mapRow(row: CardRow): Card {
|
||||
return {
|
||||
id: row.id,
|
||||
question: row.question,
|
||||
response: row.response,
|
||||
theme: row.theme,
|
||||
tags: row.tags ? JSON.parse(row.tags) : [],
|
||||
tags: this.parseTags(row.tags),
|
||||
createdAt: new Date(row.createdAt),
|
||||
updatedAt: new Date(row.updatedAt),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user