Created
June 8, 2020 18:32
-
-
Save alexandargyurov/08b31959330dfee5c94b665fcf72f0d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async blogNameToId(blogSlug) { | |
| const blogsTable = await fetch( | |
| "https://notion-api.splitbee.io/v1/table/4a900f47ce9143b59695cf25d8461893" | |
| ).then(res => res.json()); | |
| try { | |
| const blog = blogsTable.filter(blog => blog.slug === blogSlug).pop(); | |
| return blog.id | |
| } catch { | |
| return null | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment