I have a dynamic form in my reactive attendance system for employees. When I click on submit, I need to generate JSON data like the following:
{
"user_id": "1",
"branch_id": "4",
"auth_token": "59a2a9337afb07255257199b03ed6076",
"date": "2019-11-12",
"attendance_log": [
{
"emp_id": "1",
"status": "Preset"
},
{
"emp_id": "1",
"status": "Preset"
},
{
"emp_id": "1",
"status": "Preset"
}
]
}
After that, I need to pass this JSON data to the backend API.
How should I proceed?