From 8500f14ff6d2ed2207fe01301c3fd9b3b073636a Mon Sep 17 00:00:00 2001 From: Bastien Seree Date: Thu, 19 Dec 2024 17:26:19 +0100 Subject: [PATCH] EDF: [#128] fix generate order returned type --- backend/web/server/plugins/entreprisedufutur/actions.js | 4 ++-- studio-test/src/dependencies/utils/actions.js | 2 ++ studio/src/dependencies/utils/actions.js | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/web/server/plugins/entreprisedufutur/actions.js b/backend/web/server/plugins/entreprisedufutur/actions.js index d37dc7826..b1277485c 100644 --- a/backend/web/server/plugins/entreprisedufutur/actions.js +++ b/backend/web/server/plugins/entreprisedufutur/actions.js @@ -176,7 +176,7 @@ const generateOrder = async ({value,nb_tickets}, user) => { await OrderTicket.create({order: order._id, status}) } } - return order._id + return order } addAction('generate_order', generateOrder) @@ -242,7 +242,7 @@ const validateOrder = async ({value}, user) => { //order status update await Order.findByIdAndUpdate(order._id, {status: ORDER_STATUS_VALIDATED}) - return value + return order } addAction('validate_order', validateOrder) diff --git a/studio-test/src/dependencies/utils/actions.js b/studio-test/src/dependencies/utils/actions.js index 53730a8c0..5edfb293a 100644 --- a/studio-test/src/dependencies/utils/actions.js +++ b/studio-test/src/dependencies/utils/actions.js @@ -1211,6 +1211,7 @@ return Promise.allSettled(imagePromises) nb_tickets } return axios.post(url, body) + .then(res => ({value: res.data})) }, validate_order: ({value}) => { @@ -1220,5 +1221,6 @@ return Promise.allSettled(imagePromises) value: value?._id, } return axios.post(url, body) + .then(res => ({value: res.data})) }, } diff --git a/studio/src/dependencies/utils/actions.js b/studio/src/dependencies/utils/actions.js index 53730a8c0..5edfb293a 100644 --- a/studio/src/dependencies/utils/actions.js +++ b/studio/src/dependencies/utils/actions.js @@ -1211,6 +1211,7 @@ return Promise.allSettled(imagePromises) nb_tickets } return axios.post(url, body) + .then(res => ({value: res.data})) }, validate_order: ({value}) => { @@ -1220,5 +1221,6 @@ return Promise.allSettled(imagePromises) value: value?._id, } return axios.post(url, body) + .then(res => ({value: res.data})) }, }