Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Improve Lesson Upsert to Typesense #347

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

Creeland
Copy link
Contributor

@Creeland Creeland commented Dec 13, 2024

zardoz

What Changed

  • Added schema validation for Typesense documents using Zod
  • Split Typesense logic into separate query and schema files
  • Added published_at field support in egghead lesson updates
  • Enhanced instructor metadata in Typesense documents
  • Added tags to Typesense documents

Why

These changes improve the reliability and maintainability of our Typesense integration:

  1. Schema validation ensures we're sending valid data to Typesense
  2. Better organization of code with separate schema and query files
  3. Proper tracking of publish dates for content
  4. Trimmed TypeSense records down to what was needed

Issues

EGG-392: Lessons previously published via course builder have null published_at attributes

- Added `published_at` field to the `updateEggheadLesson` function to track lesson publication time.
- Modified the `writePostUpdateToDatabase` function to set `published_at` when a post is published.
- Changed `published_at` field type from `number` to `string` in `updateEggheadLesson` function to store ISO date format.
- Updated `writePostUpdateToDatabase` to use ISO string for `published_at`.
- Introduced new `typesense-query.ts` file for managing Typesense operations, including upserting posts.
- Enhanced `InstructorSchema` and `TypesensePostSchema` to include additional instructor details and ensure proper validation.
- Refactored import paths for better organization.
@Creeland Creeland added the enhancement New feature or request label Dec 13, 2024
@Creeland Creeland self-assigned this Dec 13, 2024
Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ai-hero ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 11:17pm
astro-party ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 11:17pm
course-builder-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 11:17pm
course-builder-poc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 11:17pm
course-builder-video-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 11:17pm
epic-react-builder ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 11:17pm
epic-web-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 11:17pm
go-local-first ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 11:17pm
pro-aws ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 11:17pm
pro-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 11:17pm
value-based-design ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 11:17pm

@kodiakhq kodiakhq bot merged commit 214966d into main Dec 13, 2024
28 checks passed
@kodiakhq kodiakhq bot deleted the creeland/fix-lesson-upsert-to-typesense branch December 13, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants