fix(DicomUploadService): Remove require usage (#649)

This commit is contained in:
Erik Ziegler 2019-07-11 12:18:25 +02:00 committed by GitHub
parent 1a9cfea365
commit 3a4ee9e346
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 },
});