How to send Multiple array body with API in React native

Viewed 25

that type of API data i want to send with APIs

i also want to send the value from radio button but i am new in React native that's why i don't know how to send these type of data with API

the value in category is the value that is comes from radio button of yes and no. I don't know how to set these radio button value in categories[0][value] : 1

My code in expo snack for Edit

1 Answers

this is the payload you need to form, add the respective values to it

{
  score_threshold: "",
  categories: [
    {
      sub_category_id: "",
      value: "",
      category_id: "",
      sub_category_name: "",
    },
    {
      sub_category_id: "",
      value: "",
      category_id: "",
      sub_category_name: "",
    },
  ],
};
Related