//edit file
export class EditStoreComponent implements OnInit {
name = '';
id: ''
constructor(private api:APIService, private router:Router, private cookieService: CookieService, private route:ActivatedRoute) {
}
ngOnInit() {
}
async updateStore(){
let req = {
id:this.id,
name:this.name
}
console.log(req)
let result = await this.api.UpdateStore(req)
if (result){
this.router.navigate(['../admin/liststore']);
console.log(result)
}
}
}
//list file
rawlist;
name = '';
id = '';
storeid = "";
store: Store;
constructor(private api: APIService, private router: Router, private route: ActivatedRoute, private cookieService: CookieService) { }
ngOnInit() {
this.storelist();
}
//store list
async storelist() {
this.rawlist = await this.api.ListStores();
this.storelist = this.rawlist.items;
}
I am not sure how to pass ID from list to edit component. Basically i calling the api to update my data in the list. I only can passing the name, but I can not pass the id for specific user