Skip to content
10 changes: 9 additions & 1 deletion admin_ui/src/components/RowFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import { defineComponent } from "vue"
import FilterForm from "./FilterForm.vue"
import { type APIResponseMessage, getFormat, getType } from "../interfaces"
import { secondsToISO8601Duration } from "../utils"
import { secondsToISO8601Duration, syncQueryParams } from "../utils"

export default defineComponent({
props: {
Expand Down Expand Up @@ -87,6 +87,11 @@ export default defineComponent({
}
}

// adding filter params to url
syncQueryParams(this.$router.path, {
...json
})

this.$store.commit("updateFilterParams", json)
this.$store.commit("updateCurrentPageNumber", 1)

Expand All @@ -108,6 +113,9 @@ export default defineComponent({

form.reset()

// cleaning filter params from url
syncQueryParams(this.$router.path, {})

this.$store.commit("updateFilterParams", {})
this.$store.commit("updateCurrentPageNumber", 1)

Expand Down
Loading