From 8594ff0c2366b6427dbd4ed2da59b897f529f1e0 Mon Sep 17 00:00:00 2001 From: Redblueflame Date: Tue, 30 Mar 2021 17:43:28 +0200 Subject: [PATCH] Automatic redirection once you create a new version (#137) --- pages/mod/_id/newversion.vue | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pages/mod/_id/newversion.vue b/pages/mod/_id/newversion.vue index 77ee6d85..53e35b2a 100644 --- a/pages/mod/_id/newversion.vue +++ b/pages/mod/_id/newversion.vue @@ -230,16 +230,18 @@ export default { } } try { - await axios({ - url: 'https://api.modrinth.com/api/v1/version', - method: 'POST', - data: formData, - headers: { - 'Content-Type': 'multipart/form-data', - Authorization: this.$auth.token, - }, - }) - await this.$router.go(null) + const data = ( + await axios({ + url: 'https://api.modrinth.com/api/v1/version', + method: 'POST', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data', + Authorization: this.$auth.token, + }, + }) + ).data + await this.$router.push(`/mod/${data.mod_id}/version/${data.id}`) } catch (err) { this.$notify({ group: 'main',