project refactoring en clean archi

This commit is contained in:
styve Lioumba
2025-10-23 14:10:53 +02:00
parent ef02c6a537
commit 02637235e3
52 changed files with 3873 additions and 875 deletions

View File

@@ -1,8 +1,8 @@
@if (project) {
@if (project()) {
<div class="bg-white rounded-2xl border p-6 max-w-sm">
<div class="">
<h3 class="text-lg font-bold text-gray-800 mb-3">{{ project.nom }}</h3>
<p class="text-gray-800 text-sm">{{ project.description }}</p>
<h3 class="text-lg font-bold text-gray-800 mb-3">{{ project().nom }}</h3>
<p class="text-gray-800 text-sm">{{ project().description }}</p>
<div class="mt-6">
<a
[routerLink]="[]"

View File

@@ -1,9 +1,8 @@
import { Component, inject, Input, OnInit } from '@angular/core';
import { AuthService } from '@app/core/services/authentication/auth.service';
import { ProjectService } from '@app/core/services/project/project.service';
import { Project } from '@app/shared/models/project';
import { environment } from '@env/environment';
import { RouterLink } from '@angular/router';
import { ProjectFacade } from '@app/ui/projects/project.facade';
@Component({
selector: 'app-my-profile-project-item',
@@ -17,11 +16,10 @@ export class MyProfileProjectItemComponent implements OnInit {
@Input({ required: true }) projectId = '';
protected authService = inject(AuthService);
protected projectService = inject(ProjectService);
protected project: Project | undefined = undefined;
private readonly projectFacade = new ProjectFacade();
protected project = this.projectFacade.project;
ngOnInit(): void {
this.projectService.getProjectById(this.projectId).subscribe((value) => (this.project = value));
this.projectFacade.loadOne(this.projectId);
}
}