Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create transaction thread if needed #43070

Merged
merged 14 commits into from
Jun 7, 2024
Prev Previous commit
Next Next commit
update snapshot key
  • Loading branch information
luacmartins committed Jun 4, 2024
commit e3d6431a0b17838d3b457f74ab72e4eb1c838a2f
11 changes: 9 additions & 2 deletions src/libs/actions/Search.ts
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ import * as API from '@libs/API';
import type {SearchParams} from '@libs/API/parameters';
import {READ_COMMANDS} from '@libs/API/types';
import ONYXKEYS from '@src/ONYXKEYS';
import * as ReportUtils from '@libs/ReportUtils';
import * as ReportActions from './Report';

function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParams) {
@@ -38,7 +37,15 @@ function search({hash, query, policyIDs, offset, sortBy, sortOrder}: SearchParam
function createTransactionThread(hash: number, transactionID: string, reportID: string, moneyRequestReportActionID: string) {
ReportActions.openReport(reportID, '', ['cc2@cc.com'], {}, moneyRequestReportActionID);

Onyx.merge();
Onyx.merge(`${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`, {
[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]: {
data: {
[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`]: {
transactionThreadReportID: reportID
}
}
}
});
}

export {
Loading