diff --git a/frontend/src/components/Buttons/sortLogic.ts b/frontend/src/components/Buttons/sortLogic.ts index 138f03e..0835e18 100644 --- a/frontend/src/components/Buttons/sortLogic.ts +++ b/frontend/src/components/Buttons/sortLogic.ts @@ -20,9 +20,9 @@ export const sortBoxes = (boxes: Box[], sort: SortType) => { new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime() ); case "idAscending": - return a.id.localeCompare(b.id); + return a.id - b.id; case "idDescending": - return b.id.localeCompare(a.id); + return b.id - a.id; default: return 0; } diff --git a/frontend/src/types.ts b/frontend/src/types.ts index adb05db..b31f194 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -1,5 +1,5 @@ export interface Box { - id: string; + id: number; width: number; height: number; depth: number;