feat: write REST API endpoint to create step
This commit is contained in:
26
packages/backend/test/mocks/rest/api/v1/flows/create-step.js
Normal file
26
packages/backend/test/mocks/rest/api/v1/flows/create-step.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const createStepMock = async (step) => {
|
||||
const data = {
|
||||
id: step.id,
|
||||
type: step.type || 'action',
|
||||
key: step.key || null,
|
||||
appKey: step.appKey || null,
|
||||
iconUrl: step.iconUrl || null,
|
||||
webhookUrl: step.webhookUrl || null,
|
||||
status: step.status || 'incomplete',
|
||||
position: step.position,
|
||||
parameters: step.parameters || {},
|
||||
};
|
||||
|
||||
return {
|
||||
data,
|
||||
meta: {
|
||||
type: 'Step',
|
||||
count: 1,
|
||||
isArray: false,
|
||||
currentPage: null,
|
||||
totalPages: null,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export default createStepMock;
|
Reference in New Issue
Block a user