From b1097c710ba89abf9aed044a7d7444e91d04a6a7 Mon Sep 17 00:00:00 2001 From: Bruno Bernardino Date: Sat, 16 Jul 2022 21:25:10 +0100 Subject: [PATCH] Fix axios requests --- pages/billing.tsx | 11 +++-------- pages/email-password.tsx | 11 +++-------- pages/index.tsx | 11 +++-------- pages/pricing.tsx | 11 +++-------- 4 files changed, 12 insertions(+), 32 deletions(-) diff --git a/pages/billing.tsx b/pages/billing.tsx index 0c38038..da61233 100644 --- a/pages/billing.tsx +++ b/pages/billing.tsx @@ -74,14 +74,9 @@ export const getServerSideProps = async ({ req }: { req: Request }) => { try { await axios.post('https://stats.onbrn.com/api/event', { - headers: { - 'content-type': 'application/json; charset=utf-8', - }, - body: { - domain: baseUrl.replace('https://', ''), - name: 'pageview', - url: `${baseUrl}${pathname}`, - }, + domain: baseUrl.replace('https://', ''), + name: 'pageview', + url: `${baseUrl}${pathname}`, }); } catch (error) { console.log('Failed to log pageview'); diff --git a/pages/email-password.tsx b/pages/email-password.tsx index 1577d85..a492844 100644 --- a/pages/email-password.tsx +++ b/pages/email-password.tsx @@ -56,14 +56,9 @@ export const getServerSideProps = async ({ req }: { req: Request }) => { try { await axios.post('https://stats.onbrn.com/api/event', { - headers: { - 'content-type': 'application/json; charset=utf-8', - }, - body: { - domain: baseUrl.replace('https://', ''), - name: 'pageview', - url: `${baseUrl}${pathname}`, - }, + domain: baseUrl.replace('https://', ''), + name: 'pageview', + url: `${baseUrl}${pathname}`, }); } catch (error) { console.log('Failed to log pageview'); diff --git a/pages/index.tsx b/pages/index.tsx index 8c7fb35..19e3dfa 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -49,14 +49,9 @@ export const getServerSideProps = async ({ req }: { req: Request }) => { try { await axios.post('https://stats.onbrn.com/api/event', { - headers: { - 'content-type': 'application/json; charset=utf-8', - }, - body: { - domain: baseUrl.replace('https://', ''), - name: 'pageview', - url: `${baseUrl}${pathname}`, - }, + domain: baseUrl.replace('https://', ''), + name: 'pageview', + url: `${baseUrl}${pathname}`, }); } catch (error) { console.log('Failed to log pageview'); diff --git a/pages/pricing.tsx b/pages/pricing.tsx index 37ce586..fbef049 100644 --- a/pages/pricing.tsx +++ b/pages/pricing.tsx @@ -66,14 +66,9 @@ export const getServerSideProps = async ({ req }: { req: Request }) => { try { await axios.post('https://stats.onbrn.com/api/event', { - headers: { - 'content-type': 'application/json; charset=utf-8', - }, - body: { - domain: baseUrl.replace('https://', ''), - name: 'pageview', - url: `${baseUrl}${pathname}`, - }, + domain: baseUrl.replace('https://', ''), + name: 'pageview', + url: `${baseUrl}${pathname}`, }); } catch (error) { console.log('Failed to log pageview');