From 4b042c85b42629550868037389b74d6401528810 Mon Sep 17 00:00:00 2001 From: Mateusz Cholcha Date: Tue, 22 Oct 2024 14:15:49 +0200 Subject: [PATCH] chore: set debug --- composables/useGetResponse.ts | 5 +++++ composables/useNewsletter.ts | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/composables/useGetResponse.ts b/composables/useGetResponse.ts index 323262c..6968067 100644 --- a/composables/useGetResponse.ts +++ b/composables/useGetResponse.ts @@ -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', diff --git a/composables/useNewsletter.ts b/composables/useNewsletter.ts index 29c51a6..de96030 100644 --- a/composables/useNewsletter.ts +++ b/composables/useNewsletter.ts @@ -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, @@ -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, })