@@ -35,7 +35,7 @@ import useRouter from '../hooks/useRouter'
3535import { useGitRepositories } from '../services/gitRepositoryService'
3636import { useSampleTypes } from '../hooks/useSampleTypes'
3737import { getSampleProjectIcon } from '../utils/sampleProjectIcons'
38- import type { ServicesGitRepository , ServerSampleType } from '../api/api'
38+ import type { TypesGitRepository , ServerSampleType , TypesExternalRepositoryType } from '../api/api'
3939
4040const GitRepos : FC = ( ) => {
4141 const account = useAccount ( )
@@ -65,7 +65,7 @@ const GitRepos: FC = () => {
6565 // External repository states
6666 const [ externalRepoName , setExternalRepoName ] = useState ( '' )
6767 const [ externalRepoUrl , setExternalRepoUrl ] = useState ( '' )
68- const [ externalRepoType , setExternalRepoType ] = useState < 'github' | 'gitlab' | 'ado' | 'other' > ( 'github' )
68+ const [ externalRepoType , setExternalRepoType ] = useState < TypesExternalRepositoryType > ( 'github' as TypesExternalRepositoryType )
6969 const [ externalKoditIndexing , setExternalKoditIndexing ] = useState ( true )
7070
7171 const [ creating , setCreating ] = useState ( false )
@@ -129,9 +129,7 @@ const GitRepos: FC = () => {
129129 owner_id : ownerId ,
130130 repo_type : 'code' as any , // Helix-hosted code repository
131131 default_branch : 'main' ,
132- metadata : {
133- kodit_indexing : koditIndexing ,
134- } ,
132+ kodit_indexing : koditIndexing ,
135133 } )
136134
137135 // Invalidate and refetch git repositories query
@@ -167,14 +165,12 @@ const GitRepos: FC = () => {
167165 name : repoName ,
168166 description : `External ${ externalRepoType } repository` ,
169167 owner_id : ownerId ,
170- repo_type : 'project ' as any ,
168+ repo_type : 'code ' as any ,
171169 default_branch : 'main' ,
172- metadata : {
173- is_external : true ,
174- external_url : externalRepoUrl ,
175- external_type : externalRepoType ,
176- kodit_indexing : externalKoditIndexing ,
177- } ,
170+ is_external : true ,
171+ external_url : externalRepoUrl ,
172+ external_type : externalRepoType ,
173+ kodit_indexing : externalKoditIndexing ,
178174 } )
179175
180176 // Invalidate and refetch git repositories query
@@ -183,7 +179,7 @@ const GitRepos: FC = () => {
183179 setLinkRepoDialogOpen ( false )
184180 setExternalRepoName ( '' )
185181 setExternalRepoUrl ( '' )
186- setExternalRepoType ( 'github' )
182+ setExternalRepoType ( 'github' as TypesExternalRepositoryType )
187183 setExternalKoditIndexing ( true )
188184 } catch ( error ) {
189185 console . error ( 'Failed to link external repository:' , error )
@@ -283,7 +279,7 @@ const GitRepos: FC = () => {
283279 ) : repositories && repositories . length > 0 ? (
284280 /* GitHub-style list view */
285281 < Box >
286- { repositories . map ( ( repo : ServicesGitRepository ) => (
282+ { repositories . map ( ( repo : TypesGitRepository ) => (
287283 < Box
288284 key = { repo . id }
289285 sx = { {
@@ -323,10 +319,10 @@ const GitRepos: FC = () => {
323319 </ Typography >
324320
325321 { /* Chips */ }
326- { repo . metadata ?. is_external && (
322+ { repo . is_external && (
327323 < Chip
328324 icon = { < Link size = { 12 } /> }
329- label = { repo . metadata . external_type || 'External' }
325+ label = { repo . external_type || 'External' }
330326 size = "small"
331327 sx = { { height : 20 , fontSize : '0.75rem' } }
332328 />
@@ -405,7 +401,7 @@ const GitRepos: FC = () => {
405401 { sampleTypes . map ( ( type : ServerSampleType ) => (
406402 < MenuItem key = { type . id } value = { type . id } >
407403 < Box sx = { { display : 'flex' , alignItems : 'center' , gap : 1 } } >
408- { getSampleProjectIcon ( type . id , type . category , 18 ) }
404+ { getSampleProjectIcon ( type . id , undefined , 18 ) }
409405 < span > { type . name } </ span >
410406 </ Box >
411407 </ MenuItem >
0 commit comments