Spaces:
Running
Running
Update flare-ui/src/app/components/projects/projects.component.ts
Browse files
flare-ui/src/app/components/projects/projects.component.ts
CHANGED
@@ -115,16 +115,23 @@ export class ProjectsComponent implements OnInit {
|
|
115 |
}
|
116 |
});
|
117 |
}
|
118 |
-
|
119 |
editProject(project: Project) {
|
120 |
const dialogRef = this.dialog.open(ProjectEditDialogComponent, {
|
121 |
width: '500px',
|
122 |
data: { mode: 'edit', project: { ...project } }
|
123 |
});
|
124 |
-
|
125 |
dialogRef.afterClosed().subscribe(result => {
|
126 |
if (result) {
|
127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
}
|
129 |
});
|
130 |
}
|
|
|
115 |
}
|
116 |
});
|
117 |
}
|
118 |
+
|
119 |
editProject(project: Project) {
|
120 |
const dialogRef = this.dialog.open(ProjectEditDialogComponent, {
|
121 |
width: '500px',
|
122 |
data: { mode: 'edit', project: { ...project } }
|
123 |
});
|
124 |
+
|
125 |
dialogRef.afterClosed().subscribe(result => {
|
126 |
if (result) {
|
127 |
+
// Listeyi güncelle
|
128 |
+
const index = this.projects.findIndex(p => p.id === result.id);
|
129 |
+
if (index !== -1) {
|
130 |
+
this.projects[index] = result;
|
131 |
+
this.applyFilter(); // Filtreyi yeniden uygula
|
132 |
+
} else {
|
133 |
+
this.loadProjects(); // Bulunamazsa tüm listeyi yenile
|
134 |
+
}
|
135 |
}
|
136 |
});
|
137 |
}
|