Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
@@ -1,5 +1,6 @@
type RequestExpensifyCardLimitIncreaseParams = {
settlementBankAccountID: number;
fundID?: number;
};

export default RequestExpensifyCardLimitIncreaseParams;
9 changes: 8 additions & 1 deletion src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4222,13 +4222,20 @@ function openDraftWorkspaceRequest(policyID: string) {
API.read(READ_COMMANDS.OPEN_DRAFT_WORKSPACE_REQUEST, params);
}

function requestExpensifyCardLimitIncrease(settlementBankAccountID?: number) {
/**
* Ask Concierge to raise the Expensify Card limit of a card feed.
*
* The settlement account belongs to one user, usually the workspace owner. The backend needs the fundID to let
* another admin of the same feed make this request, because that admin cannot read the account on their own.
*/
function requestExpensifyCardLimitIncrease(settlementBankAccountID?: number, fundID?: number) {
if (!settlementBankAccountID) {
return;
}

const params: RequestExpensifyCardLimitIncreaseParams = {
settlementBankAccountID,
fundID,
};

API.write(WRITE_COMMANDS.REQUEST_EXPENSIFY_CARD_LIMIT_INCREASE, params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function WorkspaceCardsListLabel({type, value, style}: WorkspaceCardsListLabelPr
}, [isVisible, windowWidth]);

const requestLimitIncrease = () => {
requestExpensifyCardLimitIncrease(settings?.paymentBankAccountID);
requestExpensifyCardLimitIncrease(settings?.paymentBankAccountID, defaultFundID);
setVisible(false);
navigateToConciergeChat(conciergeReportID, introSelected, currentUserAccountID, isSelfTourViewed, betas, false);
};
Expand Down
Loading