Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async editItem() {
const flatLocationList = Loc.flatten(this.locationList);
const index = flatLocationList.locations.findIndex(location => location.id === this.form.id);
flatLocationList.locations[index] = { ...flatLocationList.locations[index], ...this.form };
this.locationList = Loc.unflatten(flatLocationList);
await this.setLocationList(this.locationList);
await this.saveLocationListToDisk();
this.isItemMarkedForUpdate = false;
this.hideLocationForm();
}
hideLocationForm() {