Mapping nested JSON object from api to json object
00:53 17 Sep 2019

My api return a nested json object and I want to map it in json object in data in vue.

My api response:

my api response

I want to map it to:

editedItem:{
  FirstName: '',
  LastName: '',
  Address: '',        
  DepartmentName: '',
}

I just want to map the DepartmentModel.DepartmentName to DepartmentName.

This is how what I've done by the way.

item contains:

item

this.editedItem = Object.assign({}, item)
javascript json