Skip to content

PlaidLink Sequence #26

@youngmi97

Description

@youngmi97

Problem

  1. The 'analyzing your data' prompt from FirstLinkDrawer.js statically waits 5 seconds
  2. The number of subscriptions found at state=2 does not reflect the actual number

Approach

  1. Move the this.props.setState at the beginning of handleOnSuccess from PlaidLinkFirst.js to when the transaction response data actually arrives
 await API.get("plaidhandler", "/transactions", {})
            .then((res) => {
              this.setState({ transactions: res.transactions.transactions });
              this.setState({ accounts: res.transactions.accounts });

              console.log("Transactions Update Successful!");

              //HERE!
              console.log("transactions", res.transactions);
              this.props.setState();
            })
            .catch((error) => {
              console.log("transactions err", error);
            });
  1. Add a new API call "transactions2service" to FirstLinkDrawer.js instead of the 5 second static waiting. And setState(2) after the response for no. of subscription has been retrieved
await API.post(
      "transaction2service",
      "/extract/subscription",
      {
        body: {
          userid: user,sub,
        },
      }
    ).then(async (response) => {
      console.log("transaction2service", response);
    });
  1. Apply the same changes to the PlaidLinkSecond.js component

Question

  1. Where is PlaidLink.js currently used? Should the above be applied to PlaidLink.js as well?

Metadata

Metadata

Assignees

Labels

React.jsIssue inherent to React.jsenhancementNew feature or requestquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions