sashankshukla / splash

2 stars 0 forks source link

ownerships display buyer dashboard #78

Closed sashankshukla closed 1 year ago

sashankshukla commented 1 year ago

the ownerships field on each user looks something like this.

{listingId:, amount}

The code is then trying to pass this ownership to build the table to display assets like this:

{user.ownerships.map((asset, idx) => {
          return (
            <PurchaseCard
              key={idx}
              name={asset.name}
              id={asset._id}
              purchasePrice={asset.purchasePrice}
              equity={asset.amount}
              currentPrice={asset.amount}
            />
          );
        })}

As you can see this makes no sense since those fields dont exist on each ownership. What we need to do is fetch assets using the GET /user/assets route and amend that route to construct out the object to look like this by acessing the actual listing.