Reset pagination when changing search field value

This commit is contained in:
Georges-Antoine Assi
2025-06-08 20:41:36 -04:00
parent d330dc7544
commit 39ce329529

View File

@@ -96,6 +96,7 @@ onMounted(() => {
// Check if search term is set in the URL (empty string is ok)
if (searchTerm.value !== null) {
romsStore.resetPagination();
fetchRoms();
}
});
@@ -105,6 +106,7 @@ watch(
(query) => {
if (query.search !== undefined && query.search !== searchTerm.value) {
searchTerm.value = query.search as string;
romsStore.resetPagination();
fetchRoms();
}
},