You've already forked AstralRinth
forked from didirus/AstralRinth
Remove lots of inline SVGs, use moment.js for times, add some pages for future work
This commit is contained in:
36
pages/user/_id.vue
Normal file
36
pages/user/_id.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div>
|
||||
<img :src="user.avatar_url" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
async asyncData(data) {
|
||||
let res = await axios.get(
|
||||
`https://api.modrinth.com/api/v1/user/${data.params.id}`
|
||||
)
|
||||
const user = res.data
|
||||
|
||||
let mods = []
|
||||
res = await axios.get(
|
||||
`https://api.modrinth.com/api/v1/user/${data.params.id}/mods`
|
||||
)
|
||||
if (res.data) {
|
||||
res = await axios.get(
|
||||
`https://api.modrinth.com/api/v1/mods/?ids=${JSON.stringify(res.data)}`
|
||||
)
|
||||
mods = res.data
|
||||
}
|
||||
|
||||
return {
|
||||
mods,
|
||||
user,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
Reference in New Issue
Block a user