fix: broken file name extension while downloading response

This commit is contained in:
Liyas Thomas
2021-01-04 07:25:03 +05:30
parent 025ead4fa3
commit ffa9210286
6 changed files with 7 additions and 8 deletions

View File

@@ -103,7 +103,7 @@ export default {
const url = URL.createObjectURL(file)
a.href = url
// TODO get uri from meta
a.download = `response on ${Date()}`.replace(/\./g, "[dot]")
a.download = `${url.split("/").pop().split("#")[0].split("?")[0]}`
document.body.appendChild(a)
a.click()
this.$refs.downloadResponse.innerHTML = this.doneButton

View File

@@ -76,8 +76,7 @@ export default {
const url = URL.createObjectURL(file)
a.href = url
// TODO get uri from meta
a.download = `${url.split("/").pop().split("#")[0].split("?")[0]}.${this.responseType}`
// `response on ${Date()}`.replace(/\./g, "[dot]")
a.download = `${url.split("/").pop().split("#")[0].split("?")[0]}`
document.body.appendChild(a)
a.click()
this.$refs.downloadResponse.innerHTML = this.doneButton

View File

@@ -112,7 +112,7 @@ export default {
const url = URL.createObjectURL(file)
a.href = url
// TODO get uri from meta
a.download = `response on ${Date()}`.replace(/\./g, "[dot]")
a.download = `${url.split("/").pop().split("#")[0].split("?")[0]}`
document.body.appendChild(a)
a.click()
this.$refs.downloadResponse.innerHTML = this.doneButton

View File

@@ -98,7 +98,7 @@ export default {
const url = URL.createObjectURL(file)
a.href = url
// TODO get uri from meta
a.download = `response on ${Date()}`.replace(/\./g, "[dot]")
a.download = `${url.split("/").pop().split("#")[0].split("?")[0]}`
document.body.appendChild(a)
a.click()
this.$refs.downloadResponse.innerHTML = this.doneButton

View File

@@ -89,7 +89,7 @@ export default {
const url = URL.createObjectURL(file)
a.href = url
// TODO get uri from meta
a.download = `response on ${Date()}`.replace(/\./g, "[dot]")
a.download = `${url.split("/").pop().split("#")[0].split("?")[0]}`
document.body.appendChild(a)
a.click()
this.$refs.downloadResponse.innerHTML = this.doneButton

View File

@@ -868,7 +868,7 @@ export default {
const a = document.createElement("a")
const url = URL.createObjectURL(file)
a.href = url
a.download = `Response ${this.url} on ${Date()}.json`.replace(/\./g, "[dot]")
a.download = `${url.split("/").pop().split("#")[0].split("?")[0]}`
document.body.appendChild(a)
a.click()
this.$refs.downloadResponse.innerHTML = this.doneButton
@@ -887,7 +887,7 @@ export default {
const a = document.createElement("a")
const url = URL.createObjectURL(file)
a.href = url
a.download = `${this.url} on ${Date()}.graphql`.replace(/\./g, "[dot]")
a.download = `${url.split("/").pop().split("#")[0].split("?")[0]}`
document.body.appendChild(a)
a.click()
this.$refs.downloadSchema.innerHTML = this.doneButton