refactor: fix bugs et réduire duplication + extraire modales BrowseComponent
- fix(dto): ajouter @IsEmail() sur contactFunctionalEmail/TechnicalEmail dans UpdateApiEntryDto - fix(docs): corriger stringify des erreurs (String(error) → error.message) - refactor(mapper): extraire toApiEntryListItem() dans api-entry.mapper.ts partagé - refactor(categories): supprimer CONVENTION_LABELS et toApiEntryListItem locaux dupliqués - refactor(browse): extraire CategoryFormModalComponent et CategoryDeleteModalComponent - refactor(api-detail): convertir editPreviewTitle() en computed() Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -4,7 +4,8 @@ import { Repository } from 'typeorm';
|
||||
import { ApiEntryEntity } from './api-entry.entity';
|
||||
import { CreateApiEntryDto } from './dto/create-api-entry.dto';
|
||||
import { UpdateApiEntryDto } from './dto/update-api-entry.dto';
|
||||
import { ApiListResponse, ApiListQuery, ApiEntry, ApiEntryListItem, ApiType, ApiStatus, ApiConvention, API_CONVENTION_LABELS } from '@datacat/shared';
|
||||
import { ApiListResponse, ApiListQuery, ApiEntry, ApiType, ApiConvention, API_CONVENTION_LABELS } from '@datacat/shared';
|
||||
import { toApiEntryListItem } from './api-entry.mapper';
|
||||
import { DocsGenerationService } from '../docs-generation/docs-generation.service';
|
||||
|
||||
/** Champs internes mis à jour par DocsGenerationService */
|
||||
@@ -151,19 +152,3 @@ function toApiEntry(entity: ApiEntryEntity): ApiEntry {
|
||||
};
|
||||
}
|
||||
|
||||
function toApiEntryListItem(entity: ApiEntryEntity): ApiEntryListItem {
|
||||
return {
|
||||
id: entity.id,
|
||||
title: buildTitle(entity.convention, entity.name),
|
||||
name: entity.name,
|
||||
convention: entity.convention,
|
||||
version: buildVersion(entity.versionMajor, entity.versionMinor, entity.versionPatch),
|
||||
description: entity.description,
|
||||
type: entity.type,
|
||||
provider: entity.provider,
|
||||
status: entity.status,
|
||||
categoryId: entity.categoryId,
|
||||
createdAt: entity.createdAt.toISOString(),
|
||||
updatedAt: entity.updatedAt.toISOString(),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user