Skip to content

Commit 83e021b

Browse files
teachable worker (#326)
* teachable worker * fmt * path token * mailerlite worker
1 parent 69c96ee commit 83e021b

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

src/_disabled/collections/courseLecturesss.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { workers } from "@/data/site.json";
12
import { defineCollection, getCollection, z } from "astro:content";
23

34
export default defineCollection({
@@ -6,7 +7,7 @@ export default defineCollection({
67
const courses = (await Promise.all(
78
_courses.map(async ({ data: { pricingPlanId } }) => {
89
const response = await fetch(
9-
`https://rtjvm-teachable-worker.andrei-023.workers.dev/curriculum/${pricingPlanId}`,
10+
`${workers.teachable}/curriculum/${pricingPlanId}`,
1011
);
1112
const responseData = await response.json();
1213

src/components/NewsletterSection.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,14 @@ const { stacked = false, title } = Astro.props;
105105
}
106106

107107
<script>
108+
import { workers } from "@/data/site.json";
108109
import { z } from "astro/zod";
109110

110111
const subscribeToNewsletterSchema = z.object({
111112
email: z.string().email(),
112113
}),
113114
subscribeToNewsletter = async (email: string) => {
114-
const url = "https://rtjvm-mailerlite-worker.andrei-023.workers.dev",
115+
const url = workers.mailerlite,
115116
route = "/",
116117
body = JSON.stringify({
117118
email,

src/data/site.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,9 @@
3737
"feed": {
3838
"url": "/articles/feed.xml"
3939
}
40+
},
41+
"workers": {
42+
"teachable": "https://teachable-worker.daniel-ciocirlan.workers.dev",
43+
"mailerlite": "https://mailerlite-worker.daniel-ciocirlan.workers.dev"
4044
}
4145
}

src/pages/courses/_components/CurriculumHelper.astro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
import { workers } from "@/data/site.json";
23
import durationToMinutes from "@/utils/durationToMinutes";
34
import { z } from "astro/zod";
45
import type { CollectionEntry } from "astro:content";
@@ -24,9 +25,7 @@ const ResponseSchema = z.array(
2425
);
2526
2627
const { color, courseId, pricingPlanId } = Astro.props,
27-
response = await fetch(
28-
`https://rtjvm-teachable-worker.andrei-023.workers.dev/curriculum/${pricingPlanId}`,
29-
),
28+
response = await fetch(`${workers.teachable}/curriculum/${pricingPlanId}`),
3029
responseData = await response.json(),
3130
lectureSections = ResponseSchema.parse(responseData);
3231
---

0 commit comments

Comments
 (0)