Skip to content

Commit

Permalink
Fix axios requests
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoBernardino committed Jul 16, 2022
1 parent e33e1ec commit b1097c7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 32 deletions.
11 changes: 3 additions & 8 deletions pages/billing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
11 changes: 3 additions & 8 deletions pages/email-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
11 changes: 3 additions & 8 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
11 changes: 3 additions & 8 deletions pages/pricing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit b1097c7

Please sign in to comment.