Skip to content

Commit

Permalink
feat: addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepdsvs committed Jan 3, 2024
1 parent 565eee4 commit b0241cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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 }: { destType: string } = ctx.request.body;
const { destType }: ContextBodySimple = ctx.request.body;

Check warning on line 48 in src/controllers/bulkUpload.ts

View check run for this annotation

Codecov / codecov/patch

src/controllers/bulkUpload.ts#L48

Added line #L48 was not covered by tests
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 }: { destType: string } = ctx.request.body;
const { destType }: ContextBodySimple = ctx.request.body;

Check warning on line 85 in src/controllers/bulkUpload.ts

View check run for this annotation

Codecov / codecov/patch

src/controllers/bulkUpload.ts#L85

Added line #L85 was not covered by tests
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 }: { destType: string } = ctx.request.body;
const { destType }: ContextBodySimple = ctx.request.body;

Check warning on line 120 in src/controllers/bulkUpload.ts

View check run for this annotation

Codecov / codecov/patch

src/controllers/bulkUpload.ts#L120

Added line #L120 was not covered by tests
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 }: { destType: string } = ctx.request.body;
const { destType }: ContextBodySimple = ctx.request.body;

Check warning on line 156 in src/controllers/bulkUpload.ts

View check run for this annotation

Codecov / codecov/patch

src/controllers/bulkUpload.ts#L156

Added line #L156 was not covered by tests
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

0 comments on commit b0241cc

Please sign in to comment.