Use base URL for axios (#241)

* Switch site to use axios base url

* Fix team invites

* Fix find/replace setting the wrong thing

* Fix analytics being blocking, small issues
This commit is contained in:
Geometrically
2021-05-28 10:19:13 -07:00
committed by GitHub
parent 03cbab5267
commit 5017c5a5f1
25 changed files with 137 additions and 209 deletions

View File

@@ -89,7 +89,6 @@
</template>
<script>
import axios from 'axios'
import SearchResult from '~/components/ui/ProjectCard'
import MFooter from '~/components/layout/MFooter'
@@ -110,19 +109,13 @@ export default {
},
async asyncData(data) {
try {
let res = await axios.get(
`https://api.modrinth.com/api/v1/user/${data.params.id}`
)
let res = await data.$axios.get(`user/${data.params.id}`)
const user = res.data
let mods = []
res = await axios.get(
`https://api.modrinth.com/api/v1/user/${user.id}/mods`
)
res = await data.$axios.get(`user/${user.id}/mods`)
if (res.data) {
res = await axios.get(
`https://api.modrinth.com/api/v1/mods?ids=${JSON.stringify(res.data)}`
)
res = await data.$axios.get(`mods?ids=${JSON.stringify(res.data)}`)
mods = res.data
}