11import React , { useCallback , useEffect } from 'react' ;
22import type { FormInputErrors , FormOnyxValues } from '@components/Form/types' ;
33import { useSearchContext } from '@components/Search/SearchContext' ;
4- import useLocalize from '@hooks/useLocalize' ;
54import useOnyx from '@hooks/useOnyx' ;
65import { clearErrorFields , clearErrors } from '@libs/actions/FormActions' ;
76import { rejectMoneyRequestsOnSearch } from '@libs/actions/Search' ;
@@ -12,7 +11,6 @@ import ONYXKEYS from '@src/ONYXKEYS';
1211import INPUT_IDS from '@src/types/form/MoneyRequestRejectReasonForm' ;
1312
1413function SearchRejectReasonPage ( ) {
15- const { translate} = useLocalize ( ) ;
1614 const context = useSearchContext ( ) ;
1715 const [ allPolicies ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY , { canBeMissing : true } ) ;
1816 const [ allReports ] = useOnyx ( ONYXKEYS . COLLECTION . REPORT , { canBeMissing : true } ) ;
@@ -25,13 +23,10 @@ function SearchRejectReasonPage() {
2523 [ context , allPolicies , allReports ] ,
2624 ) ;
2725
28- const validate = useCallback (
29- ( values : FormOnyxValues < typeof ONYXKEYS . FORMS . MONEY_REQUEST_REJECT_FORM > ) => {
30- const errors : FormInputErrors < typeof ONYXKEYS . FORMS . MONEY_REQUEST_REJECT_FORM > = getFieldRequiredErrors ( values , [ INPUT_IDS . COMMENT ] ) ;
31- return errors ;
32- } ,
33- [ translate ] ,
34- ) ;
26+ const validate = useCallback ( ( values : FormOnyxValues < typeof ONYXKEYS . FORMS . MONEY_REQUEST_REJECT_FORM > ) => {
27+ const errors : FormInputErrors < typeof ONYXKEYS . FORMS . MONEY_REQUEST_REJECT_FORM > = getFieldRequiredErrors ( values , [ INPUT_IDS . COMMENT ] ) ;
28+ return errors ;
29+ } , [ ] ) ;
3530
3631 useEffect ( ( ) => {
3732 clearErrors ( ONYXKEYS . FORMS . MONEY_REQUEST_REJECT_FORM ) ;
0 commit comments