From 90a6315e2b4d25a3a61f3eb5967342b7a874c7b2 Mon Sep 17 00:00:00 2001 From: Leonardo Matos Date: Tue, 17 Mar 2020 10:40:23 -0300 Subject: [PATCH] perf(vue): 'validContentTypes' and 'knownContentTypes' can be computed --- pages/index.vue | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index 7022ceff..63dad1bb 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1400,22 +1400,6 @@ export default { showTokenList: false, showTokenRequest: false, showTokenRequestList: false, - /** - * These are content types that can be automatically - * serialized by postwoman. - */ - knownContentTypes: ["application/json", "application/x-www-form-urlencoded"], - /** - * These are a list of Content Types known to Postwoman. - */ - validContentTypes: [ - "application/json", - "application/hal+json", - "application/xml", - "application/x-www-form-urlencoded", - "text/html", - "text/plain", - ], commonHeaders, showRequestModal: false, editRequest: {}, @@ -1532,6 +1516,22 @@ export default { }, }, computed: { + /** + * These are content types that can be automatically + * serialized by postwoman. + */ + knownContentTypes: () => ["application/json", "application/x-www-form-urlencoded"], + /** + * These are a list of Content Types known to Postwoman. + */ + validContentTypes: () => [ + "application/json", + "application/hal+json", + "application/xml", + "application/x-www-form-urlencoded", + "text/html", + "text/plain", + ], uri: { get() { return this.$store.state.request.uri ? this.$store.state.request.uri : this.url + this.path