refactor: Rename createActionStepAfterStepId as createAfterStep for flow

This commit is contained in:
Faruk AYDIN
2024-11-01 14:24:07 +01:00
parent 2c4b13e4b5
commit c641e8729b
3 changed files with 4 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ export default async (request, response) => {
.findById(request.params.flowId)
.throwIfNotFound();
const createdActionStep = await flow.createActionStepAfterStepId(
const createdActionStep = await flow.createStepAfter(
request.body.previousStepId
);

View File

@@ -176,7 +176,7 @@ class Flow extends Base {
return await Promise.all(stepPositionUpdates);
}
async createActionStepAfterStepId(previousStepId) {
async createStepAfter(previousStepId) {
const previousStep = await this.getStepById(previousStepId);
const nextSteps = await this.getStepsAfterPosition(previousStep.position);

View File

@@ -248,13 +248,13 @@ describe('Flow model', () => {
]);
});
it('createActionStepAfterStep should create an action step after given step ID', async () => {
it('createStepAfter should create an action step after given step ID', async () => {
const flow = await createFlow();
const triggerStep = await createStep({ type: 'trigger', flowId: flow.id });
const actionStep = await createStep({ type: 'action', flowId: flow.id });
const createdStep = await flow.createActionStepAfterStepId(triggerStep.id);
const createdStep = await flow.createStepAfter(triggerStep.id);
const refetchedActionStep = await actionStep.$query();