Skip to content

Commit

Permalink
Merge branch 'tag-filter-by-folder' into preview
Browse files Browse the repository at this point in the history
  • Loading branch information
banzhe committed Feb 24, 2025
2 parents b2f00f4 + 80e4ef0 commit cf15d04
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin/popup/components/SavedPageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function SavedPageList() {
className="flex justify-between bg-primary/20 rounded p-2 select-none cursor-pointer"
onClick={() => handlePageClick(page.id)}
>
<div className="flex-1">{page.title}</div>
<div className="flex-1 text-nowrap text-ellipsis overflow-hidden">{page.title}</div>
<div>{formatTime(page.createdAt)}</div>
</div>
)
Expand Down
24 changes: 24 additions & 0 deletions packages/server/src/api/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,30 @@ app.post(
},
)

app.post(
'/query_all_page_ids',
validator('json', (value, c) => {
const schema = z.object({
folderId: z.number({
message: 'Folder ID should be a number',
}),
})

const parsed = schema.safeParse(value)
if (!parsed.success) {
return c.json(result.error(400, parsed.error.errors[0].message))
}

return parsed.data
}),
async (c) => {
const { folderId } = c.req.valid('json')
const pages = await queryAllPageIds(c.env.DB, folderId)

return c.json(result.success(pages))
},
)

app.post(
'/query_by_url',
validator('json', (value, c) => {
Expand Down

0 comments on commit cf15d04

Please sign in to comment.