fix(shopping): capitalisation 1re lettre — catalogue + migration BDD v0.4.9
- CatalogueModal : cleanForm() capitalise désormais le nom avant envoi API (création et modification d'article) - Migration 005 : met à jour shopping.products.name et shopping.list_items.custom_name pour capitaliser les données existantes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -85,9 +85,14 @@ export default function CatalogueModal({ stores, onClose }: CatalogueModalProps)
|
||||
setError(null)
|
||||
}
|
||||
|
||||
function capitalize(s: string): string {
|
||||
const t = s.trim()
|
||||
return t.charAt(0).toUpperCase() + t.slice(1)
|
||||
}
|
||||
|
||||
function cleanForm(f: ProductCreate): ProductCreate {
|
||||
return {
|
||||
name: f.name.trim(),
|
||||
name: capitalize(f.name),
|
||||
brand: f.brand?.trim() || undefined,
|
||||
category: f.category?.trim() || undefined,
|
||||
description: f.description?.trim() || undefined,
|
||||
|
||||
Reference in New Issue
Block a user