@@ -76,7 +76,7 @@ export default function CreateOrEditProjectBody({
7676 const [ isExternalGitIntegration , setIsExternalGitIntegration ] = useState < boolean > ( false ) ;
7777 const [ useExternalGit , setUseExternalGit ] = useState < boolean > ( false ) ;
7878 const [ repositories , setRepositories ] = useState < any [ ] > ( [ ] ) ;
79- const [ selectedRepository , setSelectedRepository ] = useState < string | null > ( null ) ;
79+ const [ selectedRepository , setSelectedRepository ] = useState < { label : string , value : string } | null > ( null ) ;
8080
8181 async function redirectToGithubIntegration ( ) {
8282 setIntegrationLoading ( true ) ;
@@ -113,6 +113,10 @@ export default function CreateOrEditProjectBody({
113113 const handleCreateNewProject = async ( ) => {
114114 setIsLoading ( true ) ;
115115 const projectErrors = [
116+ {
117+ validation : selectedRepository === null && useExternalGit ,
118+ message : 'Please select a github repository to import.' ,
119+ } ,
116120 {
117121 validation : handleProjectDuplicationCheck ( ) ,
118122 message : 'A project with the name entered already exists.' ,
@@ -148,7 +152,8 @@ export default function CreateOrEditProjectBody({
148152 framework : selectedBackendFramework ,
149153 frontend_framework : selectedFrontendFramework ,
150154 description : projectDescription ,
151- repository : useExternalGit ? selectedRepository : undefined ,
155+ repository : useExternalGit ? selectedRepository . label : undefined ,
156+ repository_url : useExternalGit ? selectedRepository . value : undefined ,
152157 } ;
153158 await toCreateNewProject ( newProjectPayload ) ;
154159 }
@@ -351,7 +356,7 @@ export default function CreateOrEditProjectBody({
351356 { ( useExternalGit && isExternalGitIntegration ) && (
352357 < >
353358 < Select
354- onChange = { ( e ) => setSelectedRepository ( e . value ) }
359+ onChange = { ( e ) => setSelectedRepository ( e ) }
355360 className = "text-white" styles = { customStyles }
356361 options = { repositories }
357362 />
0 commit comments