Skip to content

Refactor: Change createdAt type from string to Date #158

@coderabbitai

Description

@coderabbitai

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

  1. Change the type of createdAt from string to Date in src/types/product.ts
  2. Update the sortProducts function in src/helpers/sortProducts.ts to handle Date objects correctly
  3. Update any related tests and type definitions

Context

Impact

This change will improve type safety and make date comparisons more reliable during sorting operations.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions