high-exabyte-59189
07/19/2024, 12:08 AMtry {
const response = await axios.get(apiUrl, { headers });
if (response.data && Array.isArray(response.data.data)) {
const responseData = response.data.data;
workflow.branches = responseData.map((branch) => ({ [branch.id]: branch.name }));
} else {
console.error('Error with response:', response.data);
}
} catch (error) {
console.error('HTTP Error:', error);
}
And then that array variable use it as choices? so i save the value and not the label?
Thx!high-exabyte-59189
07/19/2024, 12:10 AM