Skip to content

Commit

Permalink
Handle non-paginated data from API (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgroul authored May 21, 2021
1 parent 6f35dee commit ef8487f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default defineComponent({
},
async created() {
const response = await this.$http.get('/servers/')
this.servers = response.data.results
this.servers = response.data
},
})
</script>
4 changes: 2 additions & 2 deletions src/components/ServerModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ export default defineComponent({
},
async created() {
const response = await this.$http.get('/games/')
this.games = response.data.results
this.games = response.data
},
watch: {
async 'form.game_id'(val) {
if (val) {
this.loading = true
const response = await this.$http.get(`/games/${val}/versions/`)
this.versions = response.data.results
this.versions = response.data
this.loading = false
} else {
this.versions = []
Expand Down

0 comments on commit ef8487f

Please sign in to comment.