Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5e7c356
init removing ONYXKEYS.COLLECTION.REPORT_VIOLATIONS in ReportUtils
hungvu193 Jan 21, 2026
5c6cd03
add missing param: createTransactionPreviewConditionals
hungvu193 Jan 21, 2026
7feea3d
update generateReportAttributes params
hungvu193 Jan 21, 2026
f4a4e3e
prettier
hungvu193 Jan 21, 2026
2828449
update tests
hungvu193 Jan 21, 2026
38c3b45
linting
hungvu193 Jan 21, 2026
121ae6e
add tests TransactionPreviewUtils
hungvu193 Jan 21, 2026
0f2003e
update prepareReportKeys
hungvu193 Jan 22, 2026
cee2cd1
Merge remote-tracking branch 'origin/main' into refactor-66423
hungvu193 Jan 22, 2026
43ca3db
Merge remote-tracking branch 'origin/main' into refactor-66423
hungvu193 Jan 28, 2026
7c9a9af
update reportViolations params to use OnyxEntry
hungvu193 Jan 28, 2026
330f77b
prettier
hungvu193 Jan 28, 2026
c0f20b1
update unit tests and prettier
hungvu193 Jan 28, 2026
08689b2
Merge remote-tracking branch 'origin/main' into refactor-66423
hungvu193 Feb 2, 2026
ed43b07
merge main
hungvu193 Feb 10, 2026
076f95b
resolve conflict
hungvu193 Feb 13, 2026
98bcf77
prettier
hungvu193 Feb 13, 2026
cd31d9f
lint
hungvu193 Feb 13, 2026
68c7a9a
remove report violation from generateReportAttributes
hungvu193 Feb 13, 2026
2af212a
correct lhn violation logic
hungvu193 Feb 13, 2026
f2d6840
update test + lint
hungvu193 Feb 13, 2026
7f575f2
prettier
hungvu193 Feb 13, 2026
7bd1880
merge main
hungvu193 Feb 16, 2026
0d6000f
sync submodule
hungvu193 Feb 16, 2026
71f1fe5
remove Tag change
hungvu193 Feb 17, 2026
16b336a
resolve conflicts
hungvu193 Mar 5, 2026
8229dc6
prettier
hungvu193 Mar 5, 2026
0c7a380
update submodule
hungvu193 Mar 5, 2026
32f8e98
Merge remote-tracking branch 'origin/main' into refactor-66423
hungvu193 Mar 7, 2026
d3aa3fb
remove redundant option
hungvu193 Mar 7, 2026
b9778b6
Revert Mobile-Expensify submodule to main
MelvinBot Mar 9, 2026
489939e
Merge remote-tracking branch 'origin/main' into refactor-66423
MelvinBot Mar 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function TransactionPreviewContent({
const styles = useThemeStyles();
const {translate, preferredLocale} = useLocalize();
const {environmentURL} = useEnvironment();

const [allReportsViolations] = useOnyx(ONYXKEYS.COLLECTION.REPORT_VIOLATIONS, {canBeMissing: true});
Comment thread
hungvu193 marked this conversation as resolved.
Outdated
Comment thread
hungvu193 marked this conversation as resolved.
Outdated
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`, {canBeMissing: true});
const isParentPolicyExpenseChat = isPolicyExpenseChat(chatReport);
const transactionDetails = useMemo<Partial<TransactionDetails>>(
Expand Down Expand Up @@ -107,8 +107,9 @@ function TransactionPreviewContent({
currentUserEmail,
currentUserAccountID,
reportActions,
allReportsViolations,
}),
[areThereDuplicates, transactionPreviewCommonArguments, isReportAPolicyExpenseChat, currentUserEmail, currentUserAccountID, reportActions],
[areThereDuplicates, transactionPreviewCommonArguments, isReportAPolicyExpenseChat, currentUserEmail, currentUserAccountID, reportActions, allReportsViolations],
);

const {shouldShowRBR, shouldShowMerchant, shouldShowSplitShare, shouldShowTag, shouldShowCategory, shouldShowSkeleton, shouldShowDescription} = conditionals;
Expand Down
23 changes: 7 additions & 16 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import type {Route} from '@src/ROUTES';
import ROUTES from '@src/ROUTES';
import SCREENS from '@src/SCREENS';
import type * as OnyxTypes from '@src/types/onyx';

Check failure on line 37 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@src/types/onyx' imported multiple times

Check failure on line 37 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@src/types/onyx' imported multiple times

Check failure on line 37 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / ESLint check

'@src/types/onyx' imported multiple times
import type {
BankAccountList,
Beta,
Expand All @@ -60,7 +61,7 @@
Transaction,
TransactionViolation,
TransactionViolations,
} from '@src/types/onyx';

Check failure on line 64 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@src/types/onyx' imported multiple times

Check failure on line 64 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@src/types/onyx' imported multiple times

Check failure on line 64 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / ESLint check

'@src/types/onyx' imported multiple times
import type {ReportTransactionsAndViolations} from '@src/types/onyx/DerivedValues';
import type {Attendee, Participant} from '@src/types/onyx/IOU';
import type Locale from '@src/types/onyx/Locale';
Expand Down Expand Up @@ -1182,18 +1183,6 @@
},
});

let allReportsViolations: OnyxCollection<ReportViolations>;
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT_VIOLATIONS,
waitForCollectionCallback: true,
callback: (value) => {
if (!value) {
return;
}
allReportsViolations = value;
},
});

let onboarding: OnyxEntry<Onboarding>;
Onyx.connectWithoutView({
key: ONYXKEYS.NVP_ONBOARDING,
Expand Down Expand Up @@ -9305,7 +9294,7 @@
);
}

function hasReportViolations(reportID: string | undefined) {
function hasReportViolations(reportID: string | undefined, allReportsViolations: OnyxCollection<ReportViolations>) {
Comment thread
hungvu193 marked this conversation as resolved.
Outdated
if (!reportID) {
return false;
}
Comment thread
hungvu193 marked this conversation as resolved.
Outdated
Expand Down Expand Up @@ -12240,12 +12229,12 @@
/**
* Returns all violations for report
*/
function getReportViolations(reportID: string): ReportViolations | undefined {
function getReportViolations(reportID: string, allReportsViolations: OnyxCollection<OnyxTypes.ReportViolations>): ReportViolations | undefined {
if (!allReportsViolations) {
return undefined;
}

return allReportsViolations[`${ONYXKEYS.COLLECTION.REPORT_VIOLATIONS}${reportID}`];
return allReportsViolations?.[`${ONYXKEYS.COLLECTION.REPORT_VIOLATIONS}${reportID}`];
}

function findPolicyExpenseChatByPolicyID(policyID: string): OnyxEntry<Report> {
Expand Down Expand Up @@ -12605,18 +12594,20 @@
reportActions,
transactionViolations,
isReportArchived = false,
allReportsViolations,
}: {
report: OnyxEntry<Report>;
chatReport: OnyxEntry<Report>;
reportActions?: OnyxCollection<ReportActions>;
transactionViolations: OnyxCollection<TransactionViolation[]>;
isReportArchived: boolean;
allReportsViolations: OnyxCollection<ReportViolations>;
Comment thread
hungvu193 marked this conversation as resolved.
Outdated
}) {
const reportActionsList = reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report?.reportID}`];
const parentReportActionsList = reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report?.parentReportID}`];
const isReportSettled = isSettled(report);
const isCurrentUserReportOwner = isReportOwner(report);
const doesReportHasViolations = isDraftReport(report?.reportID) && hasReportViolations(report?.reportID);
const doesReportHasViolations = isDraftReport(report?.reportID) && hasReportViolations(report?.reportID, allReportsViolations);
const hasViolationsToDisplayInLHN = shouldDisplayViolationsRBRInLHN(report, transactionViolations);
const hasAnyTypeOfViolations = hasViolationsToDisplayInLHN || (!isReportSettled && isCurrentUserReportOwner && doesReportHasViolations);
const reportErrors = getAllReportErrors(report, reportActionsList, isReportArchived);
Expand Down
7 changes: 5 additions & 2 deletions src/libs/TransactionPreviewUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import truncate from 'lodash/truncate';
import type {OnyxEntry} from 'react-native-onyx';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -358,6 +358,7 @@ function getTransactionPreviewTextAndTranslationPaths({
}

function createTransactionPreviewConditionals({
allReportsViolations,
iouReport,
transaction,
action,
Expand All @@ -370,6 +371,7 @@ function createTransactionPreviewConditionals({
currentUserAccountID,
reportActions,
}: {
allReportsViolations: OnyxCollection<OnyxTypes.ReportViolations>;
iouReport: OnyxEntry<OnyxTypes.Report>;
transaction: OnyxEntry<OnyxTypes.Transaction> | undefined;
action: OnyxEntry<OnyxTypes.ReportAction>;
Expand Down Expand Up @@ -422,7 +424,8 @@ function createTransactionPreviewConditionals({
(violation) => violation.name === CONST.VIOLATIONS.MODIFIED_AMOUNT && (violation.type === CONST.VIOLATION_TYPES.VIOLATION || violation.type === CONST.VIOLATION_TYPES.NOTICE),
));
const hasErrorOrOnHold = hasFieldErrors || (!isFullySettled && !isFullyApproved && isTransactionOnHold);
const hasReportViolationsOrActionErrors = (isReportOwner(iouReport) && hasReportViolations(iouReport?.reportID)) || hasActionWithErrorsForTransaction(iouReport?.reportID, transaction);
const hasReportViolationsOrActionErrors =
(isReportOwner(iouReport) && hasReportViolations(iouReport?.reportID, allReportsViolations)) || hasActionWithErrorsForTransaction(iouReport?.reportID, transaction);
const isDEWSubmitFailed = hasDynamicExternalWorkflow(policy) && !!getMostRecentActiveDEWSubmitFailedAction(reportActions);
const shouldShowRBR = hasAnyViolations || hasErrorOrOnHold || hasReportViolationsOrActionErrors || hasReceiptError(transaction) || isDEWSubmitFailed;

Expand Down
10 changes: 7 additions & 3 deletions src/libs/actions/OnyxDerived/configs/reportAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ export default createOnyxDerivedValueConfig({
ONYXKEYS.SESSION,
ONYXKEYS.COLLECTION.POLICY,
ONYXKEYS.COLLECTION.REPORT_METADATA,
ONYXKEYS.COLLECTION.REPORT_VIOLATIONS,
],
compute: (
[reports, preferredLocale, transactionViolations, reportActions, reportNameValuePairs, transactions, personalDetails, session, policies],
{currentValue, sourceValues, areAllConnectionsSet},
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- _reportMetadata is not used here but we still need to detruct the reportViolations
[reports, preferredLocale, transactionViolations, reportActions, reportNameValuePairs, transactions, personalDetails, session, policies, _reportMetadata, reportViolations],
{currentValue, sourceValues, areAllConnectionsSet, }
) => {
if (!areAllConnectionsSet) {
return {
Expand Down Expand Up @@ -113,7 +115,7 @@ export default createOnyxDerivedValueConfig({
const reportNameValuePairsUpdates = sourceValues?.[ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS] ?? {};
const transactionsUpdates = sourceValues?.[ONYXKEYS.COLLECTION.TRANSACTION];
const transactionViolationsUpdates = sourceValues?.[ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS];

const allReportsViolationsUpdates = sourceValues?.[ONYXKEYS.COLLECTION.REPORT_VIOLATIONS] ?? {};
let dataToIterate = Object.keys(reports);
// check if there are any report-related updates

Expand All @@ -136,6 +138,7 @@ export default createOnyxDerivedValueConfig({
...Object.keys(reportMetadataUpdates),
...Object.keys(reportActionsUpdates),
...Object.keys(reportNameValuePairsUpdates),
...Object.keys(allReportsViolationsUpdates),
Comment thread
hungvu193 marked this conversation as resolved.
Outdated
...Array.from(reportUpdatesRelatedToReportActions),
];

Expand Down Expand Up @@ -207,6 +210,7 @@ export default createOnyxDerivedValueConfig({
reportActions,
transactionViolations,
isReportArchived,
allReportsViolations: reportViolations,
});

let brickRoadStatus;
Expand Down
38 changes: 26 additions & 12 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
Transaction,
TransactionViolations,
} from '@src/types/onyx';
import * as OnyxTypes from '@src/types/onyx';

Check failure on line 209 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

All imports in the declaration are only used as types. Use `import type`

Check failure on line 209 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

All imports in the declaration are only used as types. Use `import type`

Check failure on line 209 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / ESLint check

All imports in the declaration are only used as types. Use `import type`
import type {Decision} from '@src/types/onyx/OriginalMessage';
import type {CurrentUserPersonalDetails, Timezone} from '@src/types/onyx/PersonalDetails';
import type {ConnectionName} from '@src/types/onyx/Policy';
Expand Down Expand Up @@ -284,7 +285,7 @@
/** @deprecated This value is deprecated and will be removed soon after migration. Use the email from useCurrentUserPersonalDetails hook instead. */
let deprecatedCurrentUserLogin: string | undefined;

Onyx.connect({

Check warning on line 288 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, val is undefined
Expand All @@ -298,7 +299,7 @@
},
});

Onyx.connect({

Check warning on line 302 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.CONCIERGE_REPORT_ID,
callback: (value) => (conciergeReportID = value),
});
Expand All @@ -306,7 +307,7 @@
// map of reportID to all reportActions for that report
const allReportActions: OnyxCollection<ReportActions> = {};

Onyx.connect({

Check warning on line 310 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
callback: (actions, key) => {
if (!key || !actions) {
Expand All @@ -318,7 +319,7 @@
});

let allReports: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 322 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -327,7 +328,7 @@
});

let allPersonalDetails: OnyxEntry<PersonalDetailsList> = {};
Onyx.connect({

Check warning on line 331 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
allPersonalDetails = value ?? {};
Expand All @@ -342,7 +343,7 @@
});

let onboarding: OnyxEntry<Onboarding>;
Onyx.connect({

Check warning on line 346 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_ONBOARDING,
callback: (val) => {
if (Array.isArray(val)) {
Expand All @@ -353,13 +354,13 @@
});

let introSelected: OnyxEntry<IntroSelected> = {};
Onyx.connect({

Check warning on line 357 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_INTRO_SELECTED,
callback: (val) => (introSelected = val),
});

let allReportDraftComments: Record<string, string | undefined> = {};
Onyx.connect({

Check warning on line 363 in src/libs/actions/Report.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT,
waitForCollectionCallback: true,
callback: (value) => (allReportDraftComments = value),
Expand Down Expand Up @@ -2521,21 +2522,34 @@
});
}

function updateReportField(
report: Report,
reportField: PolicyReportField,
previousReportField: PolicyReportField,
policy: Policy,
isASAPSubmitBetaEnabled: boolean,
accountID: number,
email: string,
hasViolationsParam: boolean,
recentlyUsedReportFields: OnyxEntry<RecentlyUsedReportFields>,
function updateReportField({
report,
reportField,
previousReportField,
policy,
isASAPSubmitBetaEnabled,
accountID,
email,
hasViolationsParam,
recentlyUsedReportFields,
allReportsViolations,
shouldFixViolations = false,
) {
}: {
report: Report;
reportField: PolicyReportField;
previousReportField: PolicyReportField;
policy: Policy;
isASAPSubmitBetaEnabled: boolean;
accountID: number;
email: string;
hasViolationsParam: boolean;
recentlyUsedReportFields: OnyxEntry<RecentlyUsedReportFields>;
allReportsViolations: OnyxCollection<OnyxTypes.ReportViolations>;
shouldFixViolations: boolean | undefined;
}) {
const reportID = report.reportID;
const fieldKey = getReportFieldKey(reportField.fieldID);
const reportViolations = getReportViolations(reportID);
const reportViolations = getReportViolations(reportID, allReportsViolations);
const fieldViolation = getFieldViolation(reportViolations, reportField);
const recentlyUsedValues = recentlyUsedReportFields?.[fieldKey] ?? [];

Expand Down
19 changes: 17 additions & 2 deletions src/pages/Debug/Report/DebugReportPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type {OnyxEntry} from 'react-native-onyx';
import Button from '@components/Button';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import * as Expensicons from '@components/Icon/Expensicons';

Check warning on line 6 in src/pages/Debug/Report/DebugReportPage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used by a pattern. Direct imports from Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details

Check warning on line 6 in src/pages/Debug/Report/DebugReportPage.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used. Direct imports from @components/Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details
import ScreenWrapper from '@components/ScreenWrapper';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
Expand Down Expand Up @@ -53,6 +53,7 @@
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const theme = useTheme();
const [allReportsViolations] = useOnyx(ONYXKEYS.COLLECTION.REPORT_VIOLATIONS, {canBeMissing: true});
Comment thread
hungvu193 marked this conversation as resolved.
Outdated
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {canBeMissing: true});
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.chatReportID}`, {canBeMissing: true});
const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, {canBeMissing: true});
Expand All @@ -79,7 +80,7 @@
}

const shouldDisplayViolations = shouldDisplayViolationsRBRInLHN(report, transactionViolations);
const shouldDisplayReportViolations = isReportOwner(report) && hasReportViolations(reportID);
const shouldDisplayReportViolations = isReportOwner(report) && hasReportViolations(reportID, allReportsViolations);
const hasViolations = !!shouldDisplayViolations || shouldDisplayReportViolations;
const {reason: reasonGBR, reportAction: reportActionGBR} = DebugUtils.getReasonAndReportActionForGBRInLHNRow(report, isReportArchived) ?? {};
const {reason: reasonRBR, reportAction: reportActionRBR} =
Expand Down Expand Up @@ -149,7 +150,21 @@
: undefined,
},
];
}, [report, transactionViolations, reportID, isReportArchived, chatReport, reportActions, transactions, reportAttributes?.reportErrors, betas, priorityMode, draftComment, translate]);
}, [
report,
transactionViolations,
reportID,
allReportsViolations,
isReportArchived,
chatReport,
reportActions,
transactions,
reportAttributes?.reportErrors,
betas,
priorityMode,
draftComment,
translate,
]);

const DebugDetailsTab = useCallback(
() => (
Expand Down
23 changes: 12 additions & 11 deletions src/pages/EditReportFieldPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function EditReportFieldPage({route}: EditReportFieldPageProps) {
const session = useSession();
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: true});
const hasViolations = hasViolationsReportUtils(report?.reportID, transactionViolations, session?.accountID ?? CONST.DEFAULT_NUMBER_ID, session?.email ?? '');

const [allReportsViolations] = useOnyx(ONYXKEYS.COLLECTION.REPORT_VIOLATIONS, {canBeMissing: true});
Comment thread
hungvu193 marked this conversation as resolved.
Outdated
const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false);
const {translate} = useLocalize();
const isReportFieldTitle = isReportFieldOfTypeTitle(reportField);
Expand Down Expand Up @@ -99,18 +99,19 @@ function EditReportFieldPage({route}: EditReportFieldPageProps) {
goBack();
} else {
if (value !== '') {
updateReportField(
{...report, reportID: report.reportID},
{...reportField, value},
reportField,
policy as unknown as Policy,
updateReportField({
report: {...report, reportID: report.reportID},
reportField: {...reportField, value},
previousReportField: reportField,
policy: policy as unknown as Policy,
isASAPSubmitBetaEnabled,
session?.accountID ?? CONST.DEFAULT_NUMBER_ID,
session?.email ?? '',
hasViolations,
accountID: session?.accountID ?? CONST.DEFAULT_NUMBER_ID,
email: session?.email ?? '',
hasViolationsParam: hasViolations,
recentlyUsedReportFields,
hasOtherViolations,
);
allReportsViolations,
shouldFixViolations: hasOtherViolations ?? false,
});
}
goBack();
}
Expand Down
Loading