Description
Currently, the createdAt field in the Product type is defined as a string. This can lead to comparison issues during sorting operations.
Changes needed
- Change the type of
createdAt from string to Date in src/types/product.ts
- Update the
sortProducts function in src/helpers/sortProducts.ts to handle Date objects correctly
- Update any related tests and type definitions
Context
Impact
This change will improve type safety and make date comparisons more reliable during sorting operations.
Description
Currently, the
createdAtfield in theProducttype is defined as a string. This can lead to comparison issues during sorting operations.Changes needed
createdAtfromstringtoDateinsrc/types/product.tssortProductsfunction insrc/helpers/sortProducts.tsto handle Date objects correctlyContext
Impact
This change will improve type safety and make date comparisons more reliable during sorting operations.