mirror of https://github.com/langgenius/dify.git
feat: update test email sender mutation to include inputs and adjust API endpoint for better data handling
This commit is contained in:
parent
3bf8f19874
commit
d401a29bd9
|
|
@ -141,13 +141,14 @@ const EmailSenderModal = ({
|
|||
appID: appDetail?.id || '',
|
||||
nodeID: nodeId,
|
||||
deliveryID: deliveryId,
|
||||
inputs,
|
||||
})
|
||||
setDone(true)
|
||||
}
|
||||
finally {
|
||||
setSendingEmail(false)
|
||||
}
|
||||
}, [appDetail, nodeId, deliveryId, testEmailSender])
|
||||
}, [testEmailSender, appDetail?.id, nodeId, deliveryId, inputs])
|
||||
|
||||
if (done) {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -231,6 +231,14 @@ export const useEditInspectorVar = (flowType: FlowType, flowId: string) => {
|
|||
export const useTestEmailSender = () => {
|
||||
return useMutation({
|
||||
mutationKey: [NAME_SPACE, 'test email sender'],
|
||||
mutationFn: async (data: { appID: string, nodeID: string, deliveryID: string }) => post<CommonResponse>(`apps/${data.appID}/human-input/test-delivery/${data.nodeID}/${data.deliveryID}`),
|
||||
mutationFn: async (data: { appID: string, nodeID: string, deliveryID: string, inputs: Record<string, any> }) => {
|
||||
const { appID, nodeID, deliveryID, inputs } = data
|
||||
return post<CommonResponse>(`/apps/${appID}/workflows/draft/human-input/nodes/${nodeID}/delivery-test`, {
|
||||
body: {
|
||||
delivery_method_id: deliveryID,
|
||||
inputs,
|
||||
},
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue