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

Cosmic CMS updates #38163

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
edit: remove unused function
tonyspiro committed Jun 29, 2022
commit 2ffc3628a1498feb2d7a1747724f4734086fd2cc
8 changes: 3 additions & 5 deletions examples/cms-cosmic/lib/api.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Cosmic from 'cosmicjs'
import { Post } from 'interfaces'
import { PostType } from 'interfaces'
import ErrorPage from 'next/error'

const BUCKET_SLUG = process.env.COSMIC_BUCKET_SLUG
@@ -10,8 +10,6 @@ const bucket = Cosmic().bucket({
read_key: READ_KEY,
})

const is404 = (error) => /not found/i.test(error.message)

export const getPreviewPostBySlug = async (slug: string) => {
const params = {
query: {
@@ -59,8 +57,8 @@ export const getPostAndMorePosts = async (
slug: string,
preview: boolean
): Promise<{
post: Post
morePosts: Post[]
post: PostType
morePosts: PostType[]
}> => {
const singleObjectParams = {
query: {