Fix allUpdateSubscribe for Astro

This commit is contained in:
Sam Carlton 2022-05-01 11:39:00 -05:00
parent 8ec2e77c06
commit 4b475efea5

View file

@ -59,6 +59,7 @@
<script> <script>
import has from 'just-has'
import axios from 'axios' import axios from 'axios'
import { v4 as uuid } from 'uuid' import { v4 as uuid } from 'uuid'
@ -121,6 +122,7 @@ export default {
return Object.values(mergedClassGroups) return Object.values(mergedClassGroups)
} }
}, },
methods: { methods: {
async trySubmit () { async trySubmit () {
console.log('Trying submit') console.log('Trying submit')
@ -130,10 +132,17 @@ export default {
// const pagePath = $nuxt.$route.path // const pagePath = $nuxt.$route.path
// console.log('this.$config.allUpdateSubscribe', this.$config.allUpdateSubscribe) const isNuxt = has( this, [ '$nuxt' ])
const allUpdateSubscribe = isNuxt ? this.$config.allUpdateSubscribe : global.$config.allUpdateSubscribe
console.log('allUpdateSubscribe', allUpdateSubscribe)
// https://stackoverflow.com/questions/51995070/post-data-to-a-google-form-with-ajax/55496118#55496118 // https://stackoverflow.com/questions/51995070/post-data-to-a-google-form-with-ajax/55496118#55496118
const actionUrl = this.$config.allUpdateSubscribe const actionUrl = allUpdateSubscribe
console.log('actionUrl', actionUrl)
axios({ axios({
method: 'post', method: 'post',