Skip to content

Commit 8773202

Browse files
committed
chore: unify subscribe and contact page logic
1 parent 18d7d67 commit 8773202

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/env.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
interface ImportMetaEnv {
66
readonly MARKETING_CLOUD_AUTH: string;
7-
readonly MARKETING_CLOUD_URL: string;
7+
readonly MARKETING_CLOUD_CONTACT_URL: string;
8+
readonly MARKETING_CLOUD_SUBSCRIBE_URL: string;
89
readonly GA_TAG_ID: string;
910
readonly ONETRUST_ENABLED: string;
1011
}

src/pages/contact.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if (Astro.request.method === "POST") {
3737
if (!payload.email || !payload.category || !payload.country) {
3838
status = "error";
3939
} else {
40-
await fetch(import.meta.env.MARKETING_CLOUD_URL, {
40+
await fetch(import.meta.env.MARKETING_CLOUD_CONTACT_URL, {
4141
method: "POST",
4242
headers: {
4343
"Content-Type": "application/json",

src/pages/subscribe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const POST: APIRoute = async ({ request, redirect }) => {
3434
}
3535

3636
const response = await fetch(
37-
"https://cloud.crm.sumup.com/ae_xi_1_gl-subscribe-changelog-sumup-for-developers",
37+
import.meta.env.MARKETING_CLOUD_SUBSCRIBE_URL,
3838
{
3939
method: "POST",
4040
headers: {

0 commit comments

Comments
 (0)