Skip to content

Commit

Permalink
annagu/sort-cat-alphabetically (#75)
Browse files Browse the repository at this point in the history
* change value selection to general/high

* change value buttons to general/high instead 2

* fix value error

* sort categories alphabetically

* sort categories alphabetically

* sort display and categories alphabetically
  • Loading branch information
axgu authored Jun 15, 2024
1 parent 2e947ae commit 18f2ed3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ enum RetrieveLocation {
}

enum Category {
CLOTHING
BEVERAGE_CONTAINER
CHARGER
UMBRELLA
CLOTHING
EARBUDS_HEADPHONES_CASES
GLASSES_CASES
JEWELRY_WATCHES
EARBUDS_HEADPHONES_CASES
KEYS
PHONES_LAPTOPS_TABLETS
BEVERAGE_CONTAINER
STATIONARY
KEYS
UMBRELLA
OTHER
}

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 @@ -45,15 +45,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 18f2ed3

Please sign in to comment.