I have initial values in react redux state which is basically fetched from an API. which is in the data
let data = {
item: [],
name: "random",
description: "hello",
status: "true",
asset: [],
version: "0.043",
}
now I want to replace the item array [] from the dat with the item array below
let item = [
{
item:
{
name: "random",
description: "General Description",
status: "true",
asset: [],
version: "0.043",
},
quantity: "344"
},
{
item: {
name: "random",
description: "General Description",
status: "true",
asset: [],
version: "0.043"
},
quantity: "434"
}
]
what I want to achieve is to update the react redux state and then post it to the Api
data = {
item: [
{
item: {
name: "random",
descr: "General Descr",
status: "true",
asset: [],
version: "0.043",
},
quantity: "344"
},
{
item: {
name: "random",
descr: "General Descr",
status: "true",
asset: [],
version: "0.043",
},
quantity: "344"
}
],
name: "random",
description: "hello",
status: "true",
asset: [],
version: "0.043",
}