Hello, as a newcomer to Angular, I am encountering an issue with my JSON list. Below is the data:
{Id: 1, Name: "A", Status: false, CustTrack: false, RoleId: 1}
{Id: 2, Name: "B", Status: true, CustTrack: false, RoleId: 1}
{Id: 3, Name: "C", Status: true, CustTrack: false, RoleId: 1}
{Id: 5, Name: "D", Status: true, CustTrack: false, RoleId: 1, …}
{Id: 5, Name: "E", Status: true, CustTrack: false, RoleId: 1, …}
{Id: 6, Name: "F", Status: true, CustTrack: false, RoleId: 1, …}
{Id: 7, Name: "G", Status: true, CustTrack: false, RoleId: 1, …}
I am looking to send the above JSON list to the server using a POST request, and here is the format for the request:
{
"LocationId": 0,
"StaffId": 0,
"CardDetails": [
{
"id": 0,
"Name": "string",
"Status": true,
"CustTrack": true,
"RoleId": 0
}
]
}
Any suggestions on how I can accomplish this task?
Here is the desired JSON format: [{"Id":1,"Name":"A","Status":false,"CustTrack":false,"RoleId":1,"LocationId":2,"CurrentStatus":false},{"Id":2,"Name":"B","Status":true,"CustTrack":false,"RoleId":1,"LocationId":2,"CurrentStatus":false},{"Id":3,"Name":"C","Status":true,"CustTrack":false,"RoleId":1,"LocationId":2,"CurrentStatus":false},]