API 응답값
{
"rows": [
{
"id": 1000,
"name": "Reservation 1",
"amounts": [
{
"amount": 50000
}
],
"guests": [
{
"name": "Joe Biden"
},
{
"name": "Ally Biden"
}
]
}
]
}
YAML responseFn 키 사용
responseFn: |
const result = rows.map(e => {
return {
value: e.id,
label: e.name,
amounts: e.amounts,
amount_total: _.sum(e.amounts.map(e => e.amount)),
guest1_name: e.guests[0],
guest2_name: e.guests[1] ? e.guests[1].name : '',
}
})
return result
Output(first row):
- 1000
- Reservation 1
- JSON
[{amount: 50000}]
- 50000
- Joe Biden
- Ally Biden
Lifecycle
[사용자요청] → requestFn → requestSubmitFn → requestParamFn → [실제 쿼리/API 실행] → responseFn → responseRowFn → [사용자표시]