diff --git a/src/schema/opportunity.ts b/src/schema/opportunity.ts index 973bedf0be..ae46910f16 100644 --- a/src/schema/opportunity.ts +++ b/src/schema/opportunity.ts @@ -2354,6 +2354,15 @@ export const resolvers: IResolvers = traceResolvers< break; } + case OpportunityState.LIVE: { + if (!ctx.isTeamMember) { + throw new ConflictError('Invalid state transition'); + } + + await ctx.con.getRepository(OpportunityJob).update({ id }, { state }); + + break; + } case OpportunityState.CLOSED: if (opportunity.state !== OpportunityState.LIVE) { throw new ConflictError(`This opportunity is not live`);