Files
trouvetonprofile/src/app/shared/components/my-profile-project-list/my-profile-project-list.component.ts
styve Lioumba b90e78e1b7
All checks were successful
Build Check / build (push) Successful in 3m8s
Build Check / build (pull_request) Successful in 3m19s
refacto : restructuration du projet
2025-12-23 09:06:41 +01:00

33 lines
1.2 KiB
TypeScript

import { Component, input, OnInit, signal } from '@angular/core';
import { PaginatorModule } from 'primeng/paginator';
import { ReactiveFormsModule } from '@angular/forms';
import { UntilDestroy } from '@ngneat/until-destroy';
import { MyProfileUpdateProjectFormComponent } from '@app/shared/components/my-profile-update-project-form/my-profile-update-project-form.component';
import { ProjectFacade } from '@app/adapters/projects/project.facade';
@Component({
selector: 'app-my-profile-project-list',
standalone: true,
imports: [PaginatorModule, ReactiveFormsModule, MyProfileUpdateProjectFormComponent],
templateUrl: './my-profile-project-list.component.html',
styleUrl: './my-profile-project-list.component.scss',
})
@UntilDestroy()
export class MyProfileProjectListComponent implements OnInit {
projectIds = input.required<string[]>();
userId = input<string>('');
protected projectIdSelected = signal<string | null>(null);
private readonly projectFacade = new ProjectFacade();
protected projects = this.projectFacade.projects;
ngOnInit(): void {
this.projectFacade.load(this.userId());
}
onProjectFormSubmitted($event: string | null) {
this.projectIdSelected.set(null);
}
}