Skip to content

Commit

Permalink
Merge pull request #40704 from GandalfGwaihir/issue40464
Browse files Browse the repository at this point in the history
[Fix]: Fix crash on Expense Report Title due to mismatch of `reportKey` on the `FE` and `BE`
  • Loading branch information
thienlnam authored Apr 24, 2024
2 parents c57754a + 7ee763d commit fd8ef99
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2289,6 +2289,12 @@ function getTitleReportField(reportFields: Record<string, PolicyReportField>) {
* Get the key for a report field
*/
function getReportFieldKey(reportFieldId: string) {
// We don't need to add `expensify_` prefix to the title field key, because backend stored title under a unique key `text_title`,
// and all the other report field keys are stored under `expensify_FIELD_ID`.
if (reportFieldId === CONST.REPORT_FIELD_TITLE_FIELD_ID) {
return reportFieldId;
}

return `expensify_${reportFieldId}`;
}

Expand Down

0 comments on commit fd8ef99

Please sign in to comment.