From 5ef1b5b75c2f6fe76c44eada1613ce623ba8e770 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Mon, 13 Jan 2020 23:48:20 -0500 Subject: [PATCH] Refactor index.vue to use Network Strategies --- pages/index.vue | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index 422b6ade5..9f61a3d6e 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1128,6 +1128,7 @@ import getEnvironmentVariablesFromScript from "../functions/preRequest"; import parseTemplateString from "../functions/templating"; import AceEditor from "../components/ace-editor"; import { tokenRequest, oauthRedirect } from "../assets/js/oauth"; +import { sendNetworkRequest } from "../functions/network"; const statusCategories = [ { @@ -1985,20 +1986,8 @@ export default { if (typeof requestOptions.data === "string") { requestOptions.data = parseTemplateString(requestOptions.data); } - const config = this.$store.state.postwoman.settings.PROXY_ENABLED - ? { - method: "POST", - url: - this.$store.state.postwoman.settings.PROXY_URL || - "https://postwoman.apollotv.xyz/", - data: requestOptions - } - : requestOptions; - const response = await this.$axios(config); - return this.$store.state.postwoman.settings.PROXY_ENABLED - ? response.data - : response; + return await sendNetworkRequest(requestOptions, this.$store); }, async sendRequest() { this.$toast.clear();