fix: wire response + init error handling

This commit is contained in:
liyasthomas
2021-07-15 09:40:45 +05:30
parent 86c9e09782
commit 3ef8e677c7
16 changed files with 283 additions and 152 deletions

View File

@@ -92,6 +92,7 @@ import {
deleteGraphqlHistoryEntry,
deleteRESTHistoryEntry,
} from "~/newstore/history"
import { setRESTRequest } from "~/newstore/RESTSession"
export default {
props: {
@@ -133,7 +134,7 @@ export default {
})
},
useHistory(entry) {
this.$emit("useHistory", entry)
setRESTRequest(entry)
},
deleteHistory(entry) {
if (this.page === "rest") deleteRESTHistoryEntry(entry)

View File

@@ -36,7 +36,7 @@
@click="$emit('use-entry')"
>
<span class="truncate">
{{ `${entry.url}${entry.path}` }}
{{ `${entry.endpoint}` }}
</span>
</span>
<ButtonSecondary
@@ -70,13 +70,15 @@ export default {
},
computed: {
duration() {
const { duration } = this.entry
return duration > 0
? `${this.$t("duration")}: ${duration}ms`
: this.$t("no_duration")
if (this.entry.meta.responseDuration) {
const responseDuration = this.entry.meta.responseDuration
return responseDuration > 0
? `${this.$t("duration")}: ${responseDuration}ms`
: this.$t("no_duration")
} else return this.$t("no_duration")
},
entryStatus() {
const foundStatusGroup = findStatusGroup(this.entry.status)
const foundStatusGroup = findStatusGroup(this.entry.statusCode)
return (
foundStatusGroup || {
className: "",