You've already forked AstralRinth
forked from didirus/AstralRinth
Mod creation WIP
This commit is contained in:
@@ -1,14 +1,35 @@
|
||||
<template>
|
||||
<div>
|
||||
<img :src="user.avatar_url" />
|
||||
<div>
|
||||
<SearchResult
|
||||
v-for="(result, index) in mods"
|
||||
:id="result.mod_id"
|
||||
:key="result.mod_id"
|
||||
:name="result.title"
|
||||
:description="result.description"
|
||||
:latest-version="result.versions[0]"
|
||||
:created-at="result.published"
|
||||
:downloads="result.downloads.toString()"
|
||||
:icon-url="result.icon_url"
|
||||
:author-url="result.author_url"
|
||||
:page-url="result.page_url"
|
||||
:categories="result.categories"
|
||||
:is-ad="index === -1"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import SearchResult from '@/components/ModResult'
|
||||
|
||||
export default {
|
||||
auth: false,
|
||||
components: {
|
||||
SearchResult,
|
||||
},
|
||||
async asyncData(data) {
|
||||
let res = await axios.get(
|
||||
`https://api.modrinth.com/api/v1/user/${data.params.id}`
|
||||
@@ -21,7 +42,7 @@ export default {
|
||||
)
|
||||
if (res.data) {
|
||||
res = await axios.get(
|
||||
`https://api.modrinth.com/api/v1/mods/?ids=${JSON.stringify(res.data)}`
|
||||
`https://api.modrinth.com/api/v1/mods?ids=${JSON.stringify(res.data)}`
|
||||
)
|
||||
mods = res.data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user