Skip to content

Commit 4e7f7c3

Browse files
Merge pull request #102 from JumboCode/bug47
set page back to 1 on sorting change
2 parents 61e591f + b9381f2 commit 4e7f7c3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

frontend/src/app/inventory/page.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ function Inventory({
445445
direction = 'desc';
446446
}
447447
setSortConfig({ key, direction });
448+
setCurrentPage(1); // Reset to page 1 on sort change
448449

449450
// Call the appropriate sort function
450451
if (sortingFunctions[key]) {

0 commit comments

Comments
 (0)