Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async filterData({target}, id, type) {
- const keyinFilters = this.filters.find(filter => filter.id == id)
- if (keyinFilters) {
- const index = this.filters.findIndex(filter => filter.id == id)
- this.filters.splice(index, 1)
- }
- if (target.value) {
- this.filters.push({
- id,
- key: type === 'string' || type == 'text' ? `filter[${id}][like]` : `filter[${id}]`,
- value: target.value,
- type
- })
- }
- const query = new URLSearchParams()
- this.filters.forEach(filter => query.append(filter.key, filter.value))
- this.$store.dispatch('fetchData', query)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement