@@ -19,10 +19,12 @@ export default function AddConfigurationModal({
1919 const [ error , setError ] = useState < string | null > ( null )
2020 const [ filename , setFilename ] = useState < string > ( '' )
2121 const setProject = useProjectStore ( ( s ) => s . setProject )
22+ const baseUrl = import . meta. env . VITE_API_BASE_URL
2223
2324 const handleAdd = async ( ) => {
2425 setLoading ( true )
2526 setError ( null )
27+
2628 try {
2729 let configname = filename . trim ( )
2830 if ( ! configname ) {
@@ -35,7 +37,10 @@ export default function AddConfigurationModal({
3537 configname = `${ configname } .xml`
3638 }
3739
38- const url = `http://localhost:8080/projects/${ encodeURIComponent ( currentProject . name ) } /configurations/${ encodeURIComponent ( configname ) } `
40+ const url = `${ baseUrl } projects/${ encodeURIComponent (
41+ currentProject . name ,
42+ ) } /configurations/${ encodeURIComponent ( configname ) } `
43+
3944 const response = await fetch ( url , {
4045 method : 'POST' ,
4146 headers : { 'Content-Type' : 'application/json' } ,
@@ -66,9 +71,12 @@ export default function AddConfigurationModal({
6671 < p className = "mb-4" > Add a new configuration file.</ p >
6772
6873 < div className = "mb-4 flex items-center gap-2" >
69- < label className = "text-sm font-medium" > Filename</ label >
74+ < label className = "text-sm font-medium" htmlFor = "configuration-filename-input" >
75+ Filename
76+ </ label >
7077 < div className = "ml-2 flex w-full items-center" >
7178 < input
79+ id = "configuration-filename-input"
7280 value = { filename }
7381 onChange = { ( event ) => setFilename ( event . target . value ) }
7482 className = "border-border bg-background focus:border-foreground-active focus:ring-foreground-active w-full rounded border px-2 py-1 text-sm transition focus:ring-2 focus:outline-none"
0 commit comments