From e16796c16c943f9a94b5c8225f7174fbe5042424 Mon Sep 17 00:00:00 2001 From: ascariandrea Date: Mon, 14 Nov 2022 13:21:08 +0100 Subject: [PATCH] fix(yt:backend): return 'steps' when creating experiment --- platforms/yttrex/backend/lib/automo.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platforms/yttrex/backend/lib/automo.ts b/platforms/yttrex/backend/lib/automo.ts index 2906ff5be..8be70d7d7 100644 --- a/platforms/yttrex/backend/lib/automo.ts +++ b/platforms/yttrex/backend/lib/automo.ts @@ -17,7 +17,10 @@ import { CreatorStatContent, CreatorStats } from '@shared/models/CreatorStats'; import { GetDirectiveOutput } from '@shared/models/Experiment'; import { Step } from '@shared/models/Step'; import * as mongo3 from '@shared/providers/mongo.provider'; -import { ParsedInfo, VideoMetadata } from '@yttrex/shared/models/metadata/Metadata'; +import { + ParsedInfo, + VideoMetadata, +} from '@yttrex/shared/models/metadata/Metadata'; import { NatureType } from '@yttrex/shared/models/Nature'; import { Supporter } from '@yttrex/shared/models/Supporter'; import { differenceInSeconds, formatDistance } from 'date-fns'; @@ -918,6 +921,7 @@ async function registerSteps(steps: Step[]): Promise { status: 'exist', experimentId: exist.experimentId, since: exist.when, + steps: [], }; } @@ -929,7 +933,7 @@ async function registerSteps(steps: Step[]): Promise { }); await mongoc.close(); debug('Registered directive %s', experimentId); - return { status: 'created', experimentId, since: new Date() }; + return { status: 'created', experimentId, since: new Date(), steps }; } async function pickDirective(