willayy / DAT257-Agile

Agile project in DAT257
1 stars 0 forks source link

CardInfo in listView.tsx is invalid #41

Closed 0-Gixty-0 closed 6 months ago

0-Gixty-0 commented 6 months ago

What

CardInfo interface is an exact copy of the interface CrimeData used in the datafecthcing.tsx file. The declaration is to be removed and replaced with the imported CrimeData with all references in the file listView.tsx and eventCard.tsx replaced with the imported interface

How

Removed declared interface and imported CrimeData with references modified to correct variable name

Why

This makes the code less prone to discrepancies between the data by keeping all references to the API the same. This also follows the single responsibility principle of making the datafetching.ts file handle all connections to the API including the interface for the data.