Skip to content

Commit

Permalink
fix: load feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban committed Dec 11, 2024
1 parent 0bcf4b4 commit e3b8300
Show file tree
Hide file tree
Showing 11 changed files with 10,560 additions and 1,361 deletions.
12 changes: 7 additions & 5 deletions api/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ export async function getFeeds(): Promise<Feed[]> {
const subscriptions = await (await apiClient.subscriptions.$get({ query: {} })).json()
const reads = await (await apiClient.reads.$get({ query: {} })).json()

return subscriptions.data.map(subscription => ({
...subscription,
...subscription.feeds,
unread: reads.data[subscription.feedId] ?? 0,
}))
return subscriptions.data
.map(subscription => ({
...subscription,
...subscription.feeds,

Check failure on line 42 in api/feed.ts

View workflow job for this annotation

GitHub Actions / Test (lts/*, ubuntu-latest)

Property 'feeds' does not exist on type '{ title: string | null; createdAt: string; userId: string; view: number; category: string | null; feeds: { type: "feed"; id: string; url: string; description?: string | null | undefined; title?: string | ... 1 more ... | undefined; ... 6 more ...; tipUsers?: { ...; }[] | ... 1 more ... | undefined; }; feedId: string...'.
unread: reads.data[subscription.feedId] ?? 0,
}))
.filter(feed => !!feed.id)
}

const appStateAtom = atom('active')
Expand Down
Loading

0 comments on commit e3b8300

Please sign in to comment.