Fix some moderation bugs

This commit is contained in:
Jai A
2020-12-01 11:39:47 -07:00
parent db0dc71319
commit 992cdb992a
6 changed files with 84 additions and 68 deletions

View File

@@ -56,33 +56,25 @@ export default {
ModCard,
ModIcon,
},
async fetch() {
async asyncData(data) {
const config = {
headers: {
Authorization: this.$auth.getToken('local'),
Authorization: data.$auth.getToken('local'),
},
}
try {
let res = await axios.get(
`https://api.modrinth.com/api/v1/user/${this.$auth.user.id}/mods`,
config
)
let res = await axios.get(
`https://api.modrinth.com/api/v1/user/${data.$auth.user.id}/mods`,
config
)
res = await axios.get(
`https://api.modrinth.com/api/v1/mods?ids=${JSON.stringify(res.data)}`,
config
)
if (res.data) {
res = await axios.get(
`https://api.modrinth.com/api/v1/mods?ids=${JSON.stringify(
res.data
)}`,
config
)
this.mods = res.data
}
} catch (err) {}
},
data() {
return {
mods: [],
mods: res.data,
}
},
}