Skip to content

Commit

Permalink
sort categories alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
axgu committed Mar 16, 2024
1 parent c5cfd1c commit 697c934
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ enum Location {

enum Category {
BEVERAGE_CONTAINER
CLOTHING
CHARGER
CLOTHING
EARBUDS_HEADPHONES_CASES
GLASSES_CASES
JEWELRY_WATCHES
Expand Down
1 change: 1 addition & 0 deletions src/components/Form/Listbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default function MyListbox<T, K extends FieldValues>({
? field.value?.length > 0
? field.value
.map((value: T) => displayValue(value))
.sort()
.join(', ')
: placeholder
: field.value
Expand Down
10 changes: 5 additions & 5 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ export const Colors: Record<Color, string> = {
OTHER: 'Other'
};
export const Categories: Record<Category, string> = {
CLOTHING: 'Clothing',
BEVERAGE_CONTAINER: 'Beverage Container',
CHARGER: 'Charger',
UMBRELLA: 'Umbrellas',
CLOTHING: 'Clothing',
EARBUDS_HEADPHONES_CASES: 'Earbuds/Headphones/Case',
GLASSES_CASES: 'Glasses/Sunglasses/Cases',
JEWELRY_WATCHES: 'Jewelry/Watches',
EARBUDS_HEADPHONES_CASES: 'Earbuds/Headphones/Case',
KEYS: 'Keys',
PHONES_LAPTOPS_TABLETS: 'Phones/Laptops/Tablets',
BEVERAGE_CONTAINER: 'Beverage Container',
STATIONARY: 'Stationary',
KEYS: 'Keys',
UMBRELLA: 'Umbrellas',
OTHER: 'Other'
};

0 comments on commit 697c934

Please sign in to comment.