33 * See the LICENSE file in the repository root folder for details.
44 */
55import { useFieldArray , useForm } from 'react-hook-form' ;
6- import { ClubAccount , ReimbursementProductCreateArgs , ReimbursementReceiptUploadArgs , WbsNumber } from 'shared' ;
6+ import { ClubAccount , ReimbursementProductCreateArgs , ReimbursementReceiptUploadArgs } from 'shared' ;
77import { useGetAllExpenseTypes , useGetAllVendors } from '../../../hooks/finance.hooks' ;
88import { useToast } from '../../../hooks/toasts.hooks' ;
99import LoadingIndicator from '../../../components/LoadingIndicator' ;
@@ -14,7 +14,6 @@ import CreateReimbursementRequestFormView from './ReimbursementFormView';
1414import { useAllProjects } from '../../../hooks/projects.hooks' ;
1515import { useHistory } from 'react-router-dom' ;
1616import { routes } from '../../../utils/routes' ;
17- import { getAllWbsElements } from '../../../utils/reimbursement-request.utils' ;
1817import { useCurrentUserSecureSettings } from '../../../hooks/users.hooks' ;
1918
2019export interface ReimbursementRequestFormInput {
@@ -165,10 +164,12 @@ const ReimbursementRequestForm: React.FC<ReimbursementRequestFormProps> = ({
165164 }
166165 } ;
167166
168- const allWbsElements : {
169- wbsNum : WbsNumber ;
170- wbsName : string ;
171- } [ ] = getAllWbsElements ( allProjects ) ;
167+ const allProjectWbsElements = allProjects . map ( ( proj ) => {
168+ return {
169+ wbsNum : proj . wbsNum ,
170+ wbsName : proj . name
171+ } ;
172+ } ) ;
172173
173174 return (
174175 < CreateReimbursementRequestFormView
@@ -185,7 +186,7 @@ const ReimbursementRequestForm: React.FC<ReimbursementRequestFormProps> = ({
185186 reimbursementProductRemove = { reimbursementProductRemove }
186187 onSubmit = { onSubmitWrapper }
187188 handleSubmit = { handleSubmit }
188- allWbsElements = { allWbsElements }
189+ allWbsElements = { allProjectWbsElements }
189190 submitText = { submitText }
190191 previousPage = { previousPage }
191192 setValue = { setValue }
0 commit comments