Check if localhost before making fetch request.

This commit is contained in:
2020-07-21 18:46:16 +02:00
parent c09a29134d
commit e7b5ac1fc8

View File

@@ -58,7 +58,11 @@ export default {
})
},
makeIntent() {
fetch('/api/stripe/create-payment-intent', {
let url = '/api/stripe/create-payment-intent';
if (window.location.href.includes('localhost'))
url = 'http://localhost:30010'.concat(url)
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'