mirror of
https://github.com/azaion/ui.git
synced 2026-06-24 20:11:10 +00:00
chore: update API configuration and enhance authentication handling
- Updated Vite configuration to use the production API endpoint. - Modified TypeScript build info to include new config file. - Refactored API client to support authenticated URLs. - Updated various components to utilize the new authenticated API URL for media fetching. - Removed obsolete CSS and JS files from the distribution directory.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { useRef, useEffect, useState, useCallback, forwardRef, useImperativeHandle } from 'react'
|
||||
import { MediaType } from '../../types'
|
||||
import type { Media, AnnotationListItem, Detection, Affiliation, CombatReadiness } from '../../types'
|
||||
import { authenticatedApiUrl } from '../../api/client'
|
||||
import { getClassColor, getPhotoModeSuffix, getClassNameFallback } from './classColors'
|
||||
|
||||
interface Props {
|
||||
@@ -76,11 +77,11 @@ const CanvasEditor = forwardRef<CanvasEditorHandle, Props>(function CanvasEditor
|
||||
const img = new Image()
|
||||
img.crossOrigin = 'anonymous'
|
||||
if (annotation && !media.path.startsWith('blob:')) {
|
||||
img.src = `/api/annotations/annotations/${annotation.id}/image`
|
||||
img.src = authenticatedApiUrl(`/api/annotations/annotations/${annotation.id}/image`)
|
||||
} else if (media.path.startsWith('blob:')) {
|
||||
img.src = media.path
|
||||
} else {
|
||||
img.src = `/api/annotations/media/${media.id}/file`
|
||||
img.src = authenticatedApiUrl(`/api/annotations/media/${media.id}/file`)
|
||||
}
|
||||
img.onload = () => {
|
||||
imgRef.current = img
|
||||
|
||||
Reference in New Issue
Block a user