Skip to content

Commit

Permalink
Update getPosts.ts
Browse files Browse the repository at this point in the history
morethanmin#333

참조해서 getPosts.ts 수정
  • Loading branch information
johnmayerbass authored Jan 18, 2025
1 parent c02eb11 commit 0b12f3c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/apis/notion-client/getPosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@ export const getPosts = async () => {
} else {
// Construct Data
const pageIds = getAllPageIds(response)
const tempBlock = await (await api.getBlocks(pageIds)).recordMap.block // 추가

const data = []
for (let i = 0; i < pageIds.length; i++) {
const id = pageIds[i]
const properties = (await getPageProperties(id, block, schema)) || null
const properties = (await getPageProperties(id, tempBlock, schema)) || null
// Add fullwidth, createdtime to properties
properties.createdTime = new Date(
block[id].value?.created_time
tempBlock[id].value?.created_time
).toString()
properties.fullWidth =
(block[id].value?.format as any)?.page_full_width ?? false
(tempBlock[id].value?.format as any)?.page_full_width ?? false

data.push(properties)
}
Expand Down

0 comments on commit 0b12f3c

Please sign in to comment.