feat: update environment configuration and enhance API integration

- Remove versioning from docker-compose.yml
- Enhance Vite configuration to support API proxying for development
- Improve error handling and data normalization in API service
- Add fallback values in PublicationsTable and ResearcherCard components
- Update sync functionality in DashboardPage to handle backend responses more effectively
- Refactor mockSyncResearcher to simulate backend response structure
This commit is contained in:
Alexis
2026-04-24 10:40:28 +02:00
parent 89c45b7d67
commit 2bb1309133
9 changed files with 182 additions and 72 deletions
+7 -3
View File
@@ -16,10 +16,14 @@ export function formatDate(iso) {
/**
* Builds researcher initials (max 2 chars) from a full name.
* Si el backend aún no conoce el nombre, devolvemos un guion como
* placeholder para no dejar el avatar vacío.
*/
export function getInitials(name = "") {
return name
.trim()
export function getInitials(name) {
if (!name || typeof name !== "string") return "";
const trimmed = name.trim();
if (!trimmed) return "";
return trimmed
.split(/\s+/)
.map((w) => w[0] ?? "")
.slice(0, 2)