Version editing, user, mod, version deletion

This commit is contained in:
Geometrically
2021-01-14 21:43:58 -07:00
parent 888057f64a
commit ce1786f128
13 changed files with 879 additions and 326 deletions

View File

@@ -5,7 +5,11 @@
:members="members"
:current-member="currentMember"
>
<div v-compiled-markdown="body" v-highlightjs class="markdown-body"></div>
<div
v-compiled-markdown="mod.body"
v-highlightjs
class="markdown-body"
></div>
</ModPage>
</template>
@@ -16,15 +20,6 @@ import ModPage from '@/components/ModPage'
export default {
components: { ModPage },
auth: false,
async fetch() {
const reg = /.+?:\/\/.+?(\/.+?)(?:#|\?|$)/
const urlPath = reg.exec(this.mod.body_url)[1]
this.body = (
await axios.get(
`https://modrinth-cdn.nyc3.digitaloceanspaces.com${urlPath}`
)
).data
},
async asyncData(data) {
const config = {
headers: {
@@ -42,6 +37,10 @@ export default {
)
).data
if (mod.body_url && !mod.body) {
mod.body = (await axios.get(mod.body_url)).data
}
const [members, versions] = (
await Promise.all([
axios.get(`https://api.modrinth.com/api/v1/team/${mod.team}/members`),
@@ -90,11 +89,6 @@ export default {
})
}
},
data() {
return {
body: '',
}
},
head() {
return {
title: this.mod.title + ' - Modrinth',