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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user