Remove dependency on history component to add history entry
This commit is contained in:
@@ -98,8 +98,6 @@ import {
|
|||||||
clearGraphqlHistory,
|
clearGraphqlHistory,
|
||||||
toggleGraphqlHistoryEntryStar,
|
toggleGraphqlHistoryEntryStar,
|
||||||
toggleRESTHistoryEntryStar,
|
toggleRESTHistoryEntryStar,
|
||||||
addGraphqlHistoryEntry,
|
|
||||||
addRESTHistoryEntry,
|
|
||||||
deleteGraphqlHistoryEntry,
|
deleteGraphqlHistoryEntry,
|
||||||
deleteRESTHistoryEntry
|
deleteRESTHistoryEntry
|
||||||
} from "~/newstore/history"
|
} from "~/newstore/history"
|
||||||
@@ -155,10 +153,6 @@ export default {
|
|||||||
icon: "delete",
|
icon: "delete",
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addEntry(entry) {
|
|
||||||
if (this.page === "rest") addRESTHistoryEntry(entry)
|
|
||||||
else addGraphqlHistoryEntry(entry)
|
|
||||||
},
|
|
||||||
enableHistoryClearing() {
|
enableHistoryClearing() {
|
||||||
if (!this.history || !this.history.length) return
|
if (!this.history || !this.history.length) return
|
||||||
this.isClearingHistory = true
|
this.isClearingHistory = true
|
||||||
|
|||||||
@@ -481,6 +481,7 @@ import { commonHeaders } from "~/helpers/headers"
|
|||||||
import { getPlatformSpecialKey } from "~/helpers/platformutils"
|
import { getPlatformSpecialKey } from "~/helpers/platformutils"
|
||||||
import { sendNetworkRequest } from "~/helpers/network"
|
import { sendNetworkRequest } from "~/helpers/network"
|
||||||
import { getSettingSubject } from "~/newstore/settings"
|
import { getSettingSubject } from "~/newstore/settings"
|
||||||
|
import { addGraphqlHistoryEntry } from "~/newstore/history"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
beforeRouteLeave(_to, _from, next) {
|
beforeRouteLeave(_to, _from, next) {
|
||||||
@@ -852,8 +853,7 @@ export default {
|
|||||||
duration,
|
duration,
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Use history store system mechanism instead!
|
addGraphqlHistoryEntry(entry)
|
||||||
this.$refs.graphqlHistoryComponent.addEntry(entry)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.response = `${error}. ${this.$t("check_console_details")}`
|
this.response = `${error}. ${this.$t("check_console_details")}`
|
||||||
this.$nuxt.$loading.finish()
|
this.$nuxt.$loading.finish()
|
||||||
|
|||||||
@@ -669,6 +669,7 @@ import { httpValid } from "~/helpers/utils/valid"
|
|||||||
import { knownContentTypes, isJSONContentType } from "~/helpers/utils/contenttypes"
|
import { knownContentTypes, isJSONContentType } from "~/helpers/utils/contenttypes"
|
||||||
import { generateCodeWithGenerator } from "~/helpers/codegen/codegen"
|
import { generateCodeWithGenerator } from "~/helpers/codegen/codegen"
|
||||||
import { getSettingSubject, applySetting } from "~/newstore/settings"
|
import { getSettingSubject, applySetting } from "~/newstore/settings"
|
||||||
|
import { addRESTHistoryEntry } from "~/newstore/history"
|
||||||
import clone from "lodash/clone"
|
import clone from "lodash/clone"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -1409,8 +1410,7 @@ export default {
|
|||||||
entry.url = parseTemplateString(entry.url, environmentVariables)
|
entry.url = parseTemplateString(entry.url, environmentVariables)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Use the history store mechanism instead!
|
addRESTHistoryEntry(entry)
|
||||||
this.$refs.historyComponent.addEntry(entry)
|
|
||||||
})()
|
})()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.runningRequest = false
|
this.runningRequest = false
|
||||||
@@ -1465,8 +1465,7 @@ export default {
|
|||||||
entry.url = parseTemplateString(entry.url, environmentVariables)
|
entry.url = parseTemplateString(entry.url, environmentVariables)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Use the history state mechanism instead!
|
addRESTHistoryEntry(entry)
|
||||||
this.$refs.historyComponent.addEntry(entry)
|
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
this.response.status = error.message
|
this.response.status = error.message
|
||||||
|
|||||||
Reference in New Issue
Block a user