feat: write PATCH /v1/flows/:flowId

This commit is contained in:
Ali BARIN
2024-08-29 14:16:17 +00:00
parent 35bada360d
commit 9519ec53ef
5 changed files with 196 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
const getFlowMock = async (flow, steps) => {
const getFlowMock = async (flow, steps = []) => {
const data = {
active: flow.active,
id: flow.id,
@@ -6,7 +6,10 @@ const getFlowMock = async (flow, steps) => {
status: flow.active ? 'published' : 'draft',
createdAt: flow.createdAt.getTime(),
updatedAt: flow.updatedAt.getTime(),
steps: steps.map((step) => ({
};
if (steps.length) {
data.steps = steps.map((step) => ({
appKey: step.appKey,
iconUrl: step.iconUrl,
id: step.id,
@@ -16,8 +19,8 @@ const getFlowMock = async (flow, steps) => {
status: step.status,
type: step.type,
webhookUrl: step.webhookUrl,
})),
};
}));
}
return {
data: data,