Skip to content

Commit

Permalink
Refactor network and ProxyStrategy code
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBastin committed Jan 14, 2020
1 parent 3a8b433 commit bd008f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions functions/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import ProxyStrategy from "./strategies/ProxyStrategy";
const sendNetworkRequest = (req, store) => {
if (store.state.postwoman.settings.PROXY_ENABLED) {
return ProxyStrategy(req, store);
} else {
return AxiosStrategy(req, store);
}
}

return AxiosStrategy(req, store);
}

export { sendNetworkRequest };
4 changes: 2 additions & 2 deletions functions/strategies/ProxyStrategy.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import axios from "axios";

const proxyStrategy = async (req, store) => {
const proxyRes = await axios.post(
const { data } = await axios.post(
store.state.postwoman.settings.PROXY_URL ||
"https://postwoman.apollotv.xyz/",
req
);

return proxyRes.data;
return data;
}

export default proxyStrategy;

0 comments on commit bd008f4

Please sign in to comment.