File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
pages/copilot-request-form Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ const CopilotRequestForm: FC<{}> = () => {
4545 const [ formErrors , setFormErrors ] = useState < any > ( { } )
4646 const [ paymentType , setPaymentType ] = useState < string > ( '' )
4747 const [ projectFromQuery , setProjectFromQuery ] = useState < Project > ( )
48+ const activeProjectStatuses = [ 'active' , 'approved' , 'draft' , 'new' ]
4849
4950 const { data : copilotRequestData } : CopilotRequestResponse = useCopilotRequest ( routeParams . requestId )
5051
@@ -114,7 +115,13 @@ const CopilotRequestForm: FC<{}> = () => {
114115 label : string ;
115116 value : string ;
116117 } > > {
117- const response = await getProjects ( inputValue )
118+ const response = await getProjects ( inputValue , {
119+ filter : {
120+ status : {
121+ $in : [ activeProjectStatuses ] ,
122+ } ,
123+ } ,
124+ } )
118125 return response . map ( project => ( { label : project . name , value : project . id } ) )
119126 }
120127
Original file line number Diff line number Diff line change @@ -63,8 +63,8 @@ export const getProject = (projectId: string): Promise<Project> => {
6363 return xhrGetAsync < Project > ( url )
6464}
6565
66- export const getProjects = ( search ?: string , filter ?: any ) : Promise < Project [ ] > => {
67- const params = { name : `" ${ search } "` , ...filter }
66+ export const getProjects = ( search ?: string , config ?: { filter : any } ) : Promise < Project [ ] > => {
67+ const params = { name : search , ... config ? .filter }
6868 const url = buildUrl ( baseUrl , params )
6969 return xhrGetAsync < Project [ ] > ( url )
7070}
You can’t perform that action at this time.
0 commit comments