project refactoring en clean archi
This commit is contained in:
@@ -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]="[]"
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user