Skip to content

Commit

Permalink
Merge branch 'develop' into feat.intercom-router-transform
Browse files Browse the repository at this point in the history
  • Loading branch information
mihir-4116 authored Jan 3, 2024
2 parents 38cf816 + 7d734f0 commit cbe5a9b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/controllers/bulkUpload.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable global-require, import/no-dynamic-require, @typescript-eslint/no-unused-vars */
import { client as errNotificationClient } from '../util/errorNotifier';
import logger from '../logger';
import { CatchErr } from '../util/types';
import { CatchErr, ContextBodySimple } from '../util/types';
// TODO: To be refactored and redisgned

const getDestFileUploadHandler = (version, dest) =>
Expand Down Expand Up @@ -45,7 +45,7 @@ export const fileUpload = async (ctx) => {
return {};
};

const { destType } = ctx.request.body;
const { destType }: ContextBodySimple = ctx.request.body;
const destFileUploadHandler = getDestFileUploadHandler('v0', destType.toLowerCase());

if (!destFileUploadHandler || !destFileUploadHandler.processFileData) {
Expand Down Expand Up @@ -82,7 +82,7 @@ export const pollStatus = async (ctx) => {
JSON.stringify(ctx.request.body),
);

const { destType } = ctx.request.body;
const { destType }: ContextBodySimple = ctx.request.body;
const destFileUploadHandler = getPollStatusHandler('v0', destType.toLowerCase());
let response;
if (!destFileUploadHandler || !destFileUploadHandler.processPolling) {
Expand Down Expand Up @@ -117,7 +117,7 @@ export const getWarnJobStatus = async (ctx) => {
JSON.stringify(ctx.request.body),
);

const { destType } = ctx.request.body;
const { destType }: ContextBodySimple = ctx.request.body;
const destFileUploadHandler = getJobStatusHandler('v0', destType.toLowerCase());

if (!destFileUploadHandler || !destFileUploadHandler.processJobStatus) {
Expand Down Expand Up @@ -153,7 +153,7 @@ export const getFailedJobStatus = async (ctx) => {
JSON.stringify(ctx.request.body),
);

const { destType } = ctx.request.body;
const { destType }: ContextBodySimple = ctx.request.body;
const destFileUploadHandler = getJobStatusHandler('v0', destType.toLowerCase());

if (!destFileUploadHandler || !destFileUploadHandler.processJobStatus) {
Expand Down
3 changes: 3 additions & 0 deletions src/util/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ export type FixMe = any;

export type CatchErr = any;

export type ContextBodySimple = {
destType: string;
};
export interface Config {
cdkEnabled?: boolean;
cdkV2Enabled?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,11 @@ const ProxyRequest = async (request) => {
const addPayload = body.JSON.addConversionPayload;
// Mapping Conversion Action
const conversionId = await getConversionActionId(headers, params);
addPayload.operations.forEach((operation) => {
set(operation, 'create.transaction_attribute.conversion_action', conversionId);
});
if (Array.isArray(addPayload.operations)) {
addPayload.operations.forEach((operation) => {
set(operation, 'create.transaction_attribute.conversion_action', conversionId);
});
}
await addConversionToJob(endpoint, headers, firstResponse, addPayload);
const thirdResponse = await runTheJob(
endpoint,
Expand Down

0 comments on commit cbe5a9b

Please sign in to comment.