Skip to content

Commit

Permalink
Fix ranking fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubZojdzik committed Apr 20, 2024
1 parent c24e32e commit 69609e6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/views/RankingView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import axios from 'axios';
import VueCookie from 'vue-cookie';
import { UserTileItem } from '../components';
import { useLoggedIn } from '../composables';
Expand All @@ -9,13 +10,19 @@ export default {
data() {
return {
usrs: null,
freeze: false,
freeze: false
};
},
methods: {
async fetchData() {
const logged = await useLoggedIn();
this.usrs = (await axios.get(`${url}/users/ranking`)).data;
this.usrs = (
await axios.get(`${url}/users/ranking`, {
headers: {
authorization: `Bearer ${VueCookie.get('authorization')}`
}
})
).data;
this.usrs.forEach((x) => {
if (x.id === logged) {
x.active = true;
Expand Down

0 comments on commit 69609e6

Please sign in to comment.