Skip to content

Commit 76d87bd

Browse files
committed
chore(selectors): rename MAX_PAGE_PAGES to MAX_NOTION_PAGES for readability
1 parent abdaf2c commit 76d87bd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • apps/sim/app/api/tools/notion/pages

apps/sim/app/api/tools/notion/pages/route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const NOTION_PAGE_SIZE = 100
2121
* pages drained so a tenant with a very large workspace cannot make this route
2222
* loop unbounded. With `NOTION_PAGE_SIZE` of 100 this covers up to 2,000 items.
2323
*/
24-
const MAX_PAGE_PAGES = 20
24+
const MAX_NOTION_PAGES = 20
2525

2626
export const POST = withRouteHandler(async (request: NextRequest) => {
2727
const requestId = generateRequestId()
@@ -57,7 +57,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
5757
const results: Record<string, unknown>[] = []
5858
let startCursor: string | undefined
5959

60-
for (let page = 0; page < MAX_PAGE_PAGES; page++) {
60+
for (let page = 0; page < MAX_NOTION_PAGES; page++) {
6161
const response = await fetch('https://api.notion.com/v1/search', {
6262
method: 'POST',
6363
headers: {
@@ -94,9 +94,9 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
9494
}
9595
startCursor = data.next_cursor as string
9696

97-
if (page === MAX_PAGE_PAGES - 1) {
97+
if (page === MAX_NOTION_PAGES - 1) {
9898
logger.warn('Notion pages search hit pagination cap; results may be incomplete', {
99-
maxPages: MAX_PAGE_PAGES,
99+
maxPages: MAX_NOTION_PAGES,
100100
fetched: results.length,
101101
})
102102
}

0 commit comments

Comments
 (0)