Skip to content

Commit

Permalink
EDF: [premieroctet#128] define generate_order action with one param
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien-Wappizy committed Dec 17, 2024
1 parent 758f6c5 commit 6255ecf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
13 changes: 12 additions & 1 deletion studio-test/src/dependencies/utils/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1200,5 +1200,16 @@ return Promise.allSettled(imagePromises)
nb_tables
}
return axios.post(url, body)
}
},

generate_order: ({value, props, level, getComponentValue}) => {
const nb_tickets = getComponentValue(props.nb_tickets, level)
let url = `${API_ROOT}/action`
const body = {
action: 'generate_order',
value: value?._id,
nb_tickets
}
return axios.post(url, body)
},
}
13 changes: 12 additions & 1 deletion studio/src/dependencies/utils/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1200,5 +1200,16 @@ return Promise.allSettled(imagePromises)
nb_tables
}
return axios.post(url, body)
}
},

generate_order: ({value, props, level, getComponentValue}) => {
const nb_tickets = getComponentValue(props.nb_tickets, level)
let url = `${API_ROOT}/action`
const body = {
action: 'generate_order',
value: value?._id,
nb_tickets
}
return axios.post(url, body)
},
}
7 changes: 7 additions & 0 deletions studio/src/utils/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,13 @@ export const ACTIONS: IActions = {
},
next: [],
},
generate_order: {
label: 'generate order',
options: {
nb_tickets: ({components}) => components.map(p => ({key: p.id, label: p.id})),
},
next: [],
},
toggle_full_screen: {
label: 'Toggle full screen',
options: {},
Expand Down

0 comments on commit 6255ecf

Please sign in to comment.