re-request api on filter cha,nge

This commit is contained in:
2023-06-01 12:30:43 +02:00
parent 76b56c62ce
commit 51fbc60036
3 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ const dummyData = {
host: 1
}
setInterval(() => registerWebSocketKill(dummyData), 100)
// setInterval(() => registerWebSocketKill(dummyData), 100)
type websocketData = {
attacker_id: string,
+9 -9
View File
@@ -241,16 +241,16 @@ export const useKillStore = defineStore('kill', {
return this.nsServers || []
},
setFilter (filter:Filters) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { player: _player, ...withoutPlayers } = filter
if (this.currentFilter.player === _player) { this.fetchPlayers(withoutPlayers) }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { weapon: _weapon, ...withoutWeapon } = filter
if (this.currentFilter.weapon === _weapon) { this.fetchWeapons(withoutWeapon) }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { server: _server, ...withoutServer } = filter
// if (this.currentFilter.server === _server) { this.fetchServers(withoutServer) }
this.currentFilter = filter
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { player: _player, ...withoutPlayers } = this.currentFilter
this.fetchPlayers(withoutPlayers)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { weapon: _weapon, ...withoutWeapon } = this.currentFilter
this.fetchWeapons(withoutWeapon)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { server: _server, ...withoutServer } = this.currentFilter
this.fetchWeapons(withoutServer)
}
}
})
+1 -1
View File
@@ -195,7 +195,7 @@ export default defineComponent({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { player: _, ...withoutPlayer } = this.$route.query
router.push({ query: { player: newValue?.id, ...withoutPlayer } })// .then(e => { console.log(e) })
this.store.setFilter({ player: newValue?.id, ...this.store.currentFilter })
this.store.setFilter({ ...this.store.currentFilter, player: newValue?.id })
},
$route: {
handler: function () {