Skip to content

Instantly share code, notes, and snippets.

@alexandargyurov
Created June 8, 2020 18:32
Show Gist options
  • Select an option

  • Save alexandargyurov/08b31959330dfee5c94b665fcf72f0d4 to your computer and use it in GitHub Desktop.

Select an option

Save alexandargyurov/08b31959330dfee5c94b665fcf72f0d4 to your computer and use it in GitHub Desktop.
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