File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
app/components/adminCustomerList Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ <h1>Customer list</h1>
3
3
< div class ="span-1 ">
4
4
< div class ="flakes-actions-bar ">
5
5
< a class ="action button-gray smaller " [routerLink] ="['AdminCustomersCreate'] "> Create new customer</ a >
6
+ < span class ="action button-gray smaller " [hidden] ="!selectedCustomer " (click) ="deleteSelectedCustomer() "> Delete selected customer</ span >
6
7
</ div >
7
8
< table class ="flakes-table ">
8
9
< thead >
Original file line number Diff line number Diff line change @@ -27,4 +27,13 @@ export class AdminCustomerListComponent implements OnInit {
27
27
this . selectedCustomer = undefined ;
28
28
} ) ;
29
29
}
30
+
31
+ public deleteSelectedCustomer ( ) : void {
32
+ if ( ! this . selectedCustomer ) {
33
+ return ;
34
+ }
35
+
36
+ this . _customerApiService . remove ( this . selectedCustomer . id )
37
+ . subscribe ( ( ) => this . refresh ( ) ) ;
38
+ }
30
39
}
Original file line number Diff line number Diff line change @@ -67,3 +67,7 @@ li.router-link-active {
67
67
table .flakes-table tbody tr .active td {
68
68
background-color : lightgray ;
69
69
}
70
+
71
+ [hidden ] {
72
+ display : none ;
73
+ }
You can’t perform that action at this time.
0 commit comments