fix: wire response + init error handling
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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: "",
|
||||
|
||||
Reference in New Issue
Block a user