From 3a4ee9e346dd8daf29453092c20832ca10d10415 Mon Sep 17 00:00:00 2001 From: Erik Ziegler Date: Thu, 11 Jul 2019 12:18:25 +0200 Subject: [PATCH] fix(DicomUploadService): Remove require usage (#649) --- src/googleCloud/api/DicomUploadService.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/googleCloud/api/DicomUploadService.js b/src/googleCloud/api/DicomUploadService.js index 07250ab72..6bd6a7d83 100644 --- a/src/googleCloud/api/DicomUploadService.js +++ b/src/googleCloud/api/DicomUploadService.js @@ -1,5 +1,5 @@ import { httpErrorToStr, getOidcToken, checkDicomFile } from '../utils/helpers'; -const DICOM = require('dicomweb-client'); +import { api } from 'dicomweb-client'; class DicomUploadService { setOidcStorageKey(oidcStorageKey) { @@ -81,7 +81,7 @@ class DicomUploadService { if (!this.oidcStorageKey) throw new Error('OIDC storage key is not set'); const accessToken = getOidcToken(this.oidcStorageKey); if (!accessToken) throw new Error('OIDC access_token is not set'); - return new DICOM.api.DICOMwebClient({ + return new api.DICOMwebClient({ url, headers: { Authorization: 'Bearer ' + accessToken }, });