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

[No QA] [TS migration] Migrate 'Plaid.js' lib to TypeScript #27689

Merged
Merged
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
22 changes: 9 additions & 13 deletions src/libs/actions/Plaid.js → src/libs/actions/Plaid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import * as PlaidDataProps from '../../pages/ReimbursementAccount/plaidDataPropT

/**
* Gets the Plaid Link token used to initialize the Plaid SDK
* @param {Boolean} allowDebit
* @param {Number} bankAccountID
*/
function openPlaidBankLogin(allowDebit, bankAccountID) {
const params = getPlaidLinkTokenParameters();
params.allowDebit = allowDebit;
params.bankAccountID = bankAccountID;
function openPlaidBankLogin(allowDebit: boolean, bankAccountID: number) {
// redirect_uri needs to be in kebab case convention because that's how it's passed to the backend
const {redirectURI} = getPlaidLinkTokenParameters();
const params = {
redirectURI,
allowDebit,
bankAccountID,
};
Comment on lines +13 to +17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

androidPackage param is omitted here. This caused #38099

const optimisticData = [
{
onyxMethod: Onyx.METHOD.SET,
Expand All @@ -36,13 +38,7 @@ function openPlaidBankLogin(allowDebit, bankAccountID) {
API.read('OpenPlaidBankLogin', params, {optimisticData});
}

/**
* @param {String} publicToken
* @param {String} bankName
* @param {Boolean} allowDebit
* @param {Number} bankAccountID
*/
function openPlaidBankAccountSelector(publicToken, bankName, allowDebit, bankAccountID) {
function openPlaidBankAccountSelector(publicToken: string, bankName: string, allowDebit: boolean, bankAccountID: number) {
API.read(
'OpenPlaidBankAccountSelector',
{
Expand Down
Loading