tunedin-ctrl / Hackathon22

1 stars 0 forks source link

Input function for LoadTerryCard #10

Closed Yinnerston closed 1 year ago

Yinnerston commented 1 year ago

LoadTerryCard is the function inspired by https://github.com/Seng2021-H18A-Brownie/SENG2021_Project-Frontend/blob/main/src/pages/Login.js

Related to branch

/**
 * 
 * @param {*} load_data : Function that takes two arguments. 
 * Loads TerryCard from HTTP response data.
 * @returns 
 */
function LoadTerryCard({ load_data, ...props }) {
  /**
   * Refactoring:
   * 
   * - handling of state variables
   * - Define function input
   * 
   */
  const [loading, setLoading] = React.useState(false);
  var query_string_state = null;
  var new_terry_card = new TerryCard(); 

I have assigned the load_data function with responsibility to load the response data, as that was how login.js was implemented.

Is this the proper functionality? Problems with the current approach are:

Want to check these points and see if they are correct moving forward

Yinnerston commented 1 year ago

deleted function and moved to App.js