edit: add header to additional fetch diluar bawaan OHIF

This commit is contained in:
mario
2025-05-09 16:54:26 +07:00
parent 8d090fe19f
commit 271ba9c51e

View File

@@ -102,8 +102,20 @@ export const studyDataForOverlayItem = (studyInstanceUID: string) => {
try {
const qidoRootUrl = getQidoRootUrl();
// Get the authentication token from session storage
const authToken = window.sessionStorage.getItem('ohif-auth-token');
// Create request headers with Authorization if token exists
const headers: HeadersInit = {};
if (authToken) {
headers['Authorization'] = `Bearer ${authToken}`;
}
const response = await fetch(
`${qidoRootUrl}/studies?limit=101&offset=0&fuzzymatching=false&includefield=00080050,00081030,00101010,0010004&StudyInstanceUID=${studyInstanceUID}`
`${qidoRootUrl}/studies?limit=101&offset=0&fuzzymatching=false&includefield=00080050,00081030,00101010,0010004&StudyInstanceUID=${studyInstanceUID}`,
{
headers,
}
);
if (!response.ok) {