Skip to content

Commit

Permalink
Fix telemetry credential upload endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
NickPhura committed Dec 12, 2024
1 parent a4cdc88 commit ff76ba0
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { RequestHandler } from 'express';
import { Operation } from 'express-openapi';
import { TELEMETRY_CREDENTIAL_ATTACHMENT_TYPE } from '../../../../../../../constants/attachments';
import { PROJECT_PERMISSION, SYSTEM_ROLE } from '../../../../../../../constants/roles';
import { getDBConnection } from '../../../../../../../database/db';
import { HTTP400 } from '../../../../../../../errors/http-error';
import { fileSchema } from '../../../../../../../openapi/schemas/file';
import { authorizeRequestHandler } from '../../../../../../../request-handlers/security/authorization';
import { AttachmentService } from '../../../../../../../services/attachment-service';
import { BctwKeyxService } from '../../../../../../../services/bctw-service/bctw-keyx-service';
import { getBctwUser } from '../../../../../../../services/bctw-service/bctw-service';
import { uploadFileToS3 } from '../../../../../../../utils/file-utils';
import { getLogger } from '../../../../../../../utils/logger';
import { isValidTelementryCredentialFile } from '../../../../../../../utils/media/media-utils';
Expand Down Expand Up @@ -157,12 +154,6 @@ export function postSurveyTelemetryCredentialAttachment(): RequestHandler {
isTelemetryCredentialFile.type
);

// Upload telemetry credential file content to BCTW (for supported file types)
if (isTelemetryCredentialFile.type === TELEMETRY_CREDENTIAL_ATTACHMENT_TYPE.KEYX) {
const bctwKeyxService = new BctwKeyxService(getBctwUser(req));
await bctwKeyxService.uploadKeyX(rawMediaFile);
}

// Upload telemetry credential file to SIMS S3 Storage
const metadata = {
filename: rawMediaFile.originalname,
Expand Down

0 comments on commit ff76ba0

Please sign in to comment.