daily-code
daily-code copied to clipboard
[urgent] Let admins put a notion doc top level page that auto creates a track
Right now , the process of creating a track looks like this -
- Educator creates the track (Ref - https://www.notion.so/Redis-Pub-subs-and-Messaging-queues-2954d8a8a782433e8775dc179dff3033 )
- Mods manually seed data in the database
Would be nice if somehow all titles and pages are autoscraped so the admin can simply add the top level page (https://www.notion.so/Redis-Pub-subs-and-Messaging-queues-2954d8a8a782433e8775dc179dff3033 ) and the title, image and the page is created automatically
So the problems
in the DB need to be scraped from the top level notion page
Ref this already exists https://github.com/code100x/daily-code/pull/152
as in the UI already exists so dont recreate it
on it.
@hkirat Create a function feedNotionToDb Giving the input https://petal-estimate-4e9.notion.site/Redis-Pub-subs-and-Messaging-queues-2954d8a8a782433e8775dc179dff3033 which will give this expected output.
https://gist.github.com/SujithThirumalaisamy/0e21966605d5c039fa6fedc150243516
Is this what the scope of the issue is? Am I on the right track?
Problem: Manual addtion of the Notion to the Database Solution: Created a api endpoint to hit it from the admin pannel How It works? This api end point takes NotionLink, ImageLink with the description and seeds the tracks into the database.
https://github.com/code100x/daily-code/assets/108384868/c9a84820-7480-4e11-8e6c-5be06791d30e
Implemented the frontend successfully.
Hit the end point with ImageURL, NotionURL and Description for the Track.
**Implementation:**
1. Fetch the Title and id of the Notion document with the link
2. Fetch the page with the id and fetch all of the data in the block with the ids with the NotionAPI Client
3. Propogate the data to the database
Waiting for the suggession on improving this. @hkirat