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 2 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
24 changes: 11 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,17 @@ 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 need to be in kebab case convention because its how its passed to backend
kubabutkiewicz marked this conversation as resolved.
Show resolved Hide resolved
// eslint-disable-next-line @typescript-eslint/naming-convention
const {redirect_uri} = getPlaidLinkTokenParameters();
const params = {
// eslint-disable-next-line @typescript-eslint/naming-convention
redirect_uri,
allowDebit,
bankAccountID,
};
const optimisticData = [
{
onyxMethod: Onyx.METHOD.SET,
Expand All @@ -36,13 +40,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