Skip to content

Commit

Permalink
chore: set debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Cholcha committed Oct 22, 2024
1 parent bf723dd commit 4b042c8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions composables/useGetResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ export const useGetResponse = () => {
const webConnectEnabled = computed(() => !!config.getresponseWebConnect)

const subscribe = async (data: { email: string }) => {
// eslint-disable-next-line no-console
console.log('config.getresponseApiEnabled', config.getresponseApiEnabled)
if (!config.getresponseApiEnabled) {
// eslint-disable-next-line no-console
console.error('[useGetResponse] GetResponse key not set in environment variables')
return Promise.resolve({ success: false })
}

// eslint-disable-next-line no-console
console.log('subscribe fetch')

// sending a request to the server (nuxt)
return await fetch('/api/newsletter', {
method: 'POST',
Expand Down
11 changes: 11 additions & 0 deletions composables/useNewsletter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ export const useNewsletter = () => {
const enabled = computed(() => edroneEnabled.value || grEnabled.value)

const subscribe = async (email: string) => {
// eslint-disable-next-line no-console
console.log('subscribe')
subscribeEdrone(email)
// eslint-disable-next-line no-console
console.log('subscribe middle')
await subscribeGetResponse(email)
// eslint-disable-next-line no-console
console.log('subscribe post')
}

const subscribeEdrone = (email: string) => {
if (!edroneEnabled.value) return
// eslint-disable-next-line no-console
console.log('subscribeEdrone in')

edroneSubscribe({
email,
Expand All @@ -27,6 +35,9 @@ export const useNewsletter = () => {
const subscribeGetResponse = async (email: string) => {
if (!grEnabled.value) return

// eslint-disable-next-line no-console
console.log('subscribeEdrone in')

await grSubscribe({
email,
})
Expand Down

0 comments on commit 4b042c8

Please sign in to comment.