Skip to content

Commit

Permalink
DOP-4549 return early
Browse files Browse the repository at this point in the history
  • Loading branch information
anabellabuckvar committed Apr 18, 2024
1 parent 61dd3ea commit fe9ed63
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions api/controllers/v1/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ export const DeployRepo = async (event: any = {}): Promise<any> => {
const docsetsRepository = new DocsetsRepository(db, c, consoleLogger);
const jobRepository = new JobRepository(db, c, consoleLogger);

return {
statusCode: 200,
headers: { 'Content-Type': 'application/json' },
body: 'success!',
};

// This is coming in as urlencoded string, need to decode before parsing
const decoded = decodeURIComponent(event.body).split('=')[1];
const parsed = JSON.parse(decoded);
Expand Down Expand Up @@ -235,11 +241,6 @@ export const DeployRepo = async (event: any = {}): Promise<any> => {
}
const deployable = await getDeployableJobs(values, entitlement, repoBranchesRepository, docsetsRepository);
console.log(JSON.stringify(deployable));
return {
statusCode: 200,
headers: { 'Content-Type': 'application/json' },
body: 'success!',
};
if (deployable.length > 0) {
await deployRepo(deployable, consoleLogger, jobRepository, c.get('jobsQueueUrl'));
console.log('Repos have been deployed');
Expand Down

0 comments on commit fe9ed63

Please sign in to comment.