Skip to content

Commit

Permalink
DOP-4599 push to preprd and remove extraneous param
Browse files Browse the repository at this point in the history
  • Loading branch information
anabellabuckvar committed May 13, 2024
1 parent a89d735 commit 5eec23f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion api/controllers/v1/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export const DeployRepo = async (event: any = {}): Promise<any> => {
const isAdmin = await repoEntitlementRepository.getIsAdmin(parsed.user.id);
const optionGroups = parsed.view.blocks[0]?.element?.option_groups;
try {
values = await slackConnector.parseSelection(stateValues, isAdmin, repoBranchesRepository, optionGroups);
values = await slackConnector.parseSelection(stateValues, isAdmin, optionGroups);
} catch (e) {
console.log(`Error parsing selection: ${e}`);
return prepResponse(401, 'text/plain', e);
Expand Down
15 changes: 2 additions & 13 deletions src/services/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import axios from 'axios';
import { ILogger } from './logger';
import { IConfig } from 'config';
import * as crypto from 'crypto';
import { RepoBranchesRepository } from '../repositories/repoBranchesRepository';
export const axiosApi = axios.create();

function bufferEqual(a: Buffer, b: Buffer) {
Expand All @@ -24,12 +23,7 @@ function timeSafeCompare(a: string, b: string) {
export interface ISlackConnector {
validateSlackRequest(payload: any): boolean;
displayRepoOptions(repos: Array<string>, triggerId: string, isAdmin: boolean): Promise<any>;
parseSelection(
payload: any,
isAdmin: boolean,
repoBranchesRepository: RepoBranchesRepository,
optionGroups: any[]
): any;
parseSelection(payload: any, isAdmin: boolean, optionGroups: any[]): any;
sendMessage(message: any, user: string): Promise<any>;
}

Expand Down Expand Up @@ -59,12 +53,7 @@ export class SlackConnector implements ISlackConnector {
return {};
}

async parseSelection(
stateValues: any,
isAdmin: boolean,
repoBranchesRepository: RepoBranchesRepository,
optionGroups: any[]
): Promise<any> {
async parseSelection(stateValues: any, isAdmin: boolean, optionGroups: any[]): Promise<any> {
const values = {};
const inputMapping = {
block_repo_option: 'repo_option',
Expand Down

0 comments on commit 5eec23f

Please sign in to comment.