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<{}> = () => {
45
45
const [ formErrors , setFormErrors ] = useState < any > ( { } )
46
46
const [ paymentType , setPaymentType ] = useState < string > ( '' )
47
47
const [ projectFromQuery , setProjectFromQuery ] = useState < Project > ( )
48
+ const activeProjectStatuses = [ 'active' , 'approved' , 'draft' , 'new' ]
48
49
49
50
const { data : copilotRequestData } : CopilotRequestResponse = useCopilotRequest ( routeParams . requestId )
50
51
@@ -114,7 +115,13 @@ const CopilotRequestForm: FC<{}> = () => {
114
115
label : string ;
115
116
value : string ;
116
117
} > > {
117
- const response = await getProjects ( inputValue )
118
+ const response = await getProjects ( inputValue , {
119
+ filter : {
120
+ status : {
121
+ $in : [ activeProjectStatuses ] ,
122
+ } ,
123
+ } ,
124
+ } )
118
125
return response . map ( project => ( { label : project . name , value : project . id } ) )
119
126
}
120
127
Original file line number Diff line number Diff line change @@ -63,8 +63,8 @@ export const getProject = (projectId: string): Promise<Project> => {
63
63
return xhrGetAsync < Project > ( url )
64
64
}
65
65
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 }
68
68
const url = buildUrl ( baseUrl , params )
69
69
return xhrGetAsync < Project [ ] > ( url )
70
70
}
You can’t perform that action at this time.
0 commit comments