fix: diary page filters by authenticated user, excludes federated reviews
This commit is contained in:
@@ -12,6 +12,7 @@ import { WatchMediumBadge } from "@/components/watch-medium-badge"
|
|||||||
import { VirtualList } from "@/components/virtual-list"
|
import { VirtualList } from "@/components/virtual-list"
|
||||||
import { Button } from "@/components/ui/button"
|
import { Button } from "@/components/ui/button"
|
||||||
import { Skeleton } from "@/components/ui/skeleton"
|
import { Skeleton } from "@/components/ui/skeleton"
|
||||||
|
import { useAuth } from "@/components/auth-provider"
|
||||||
import { useInfiniteDiary, useDeleteReview } from "@/hooks/use-diary"
|
import { useInfiniteDiary, useDeleteReview } from "@/hooks/use-diary"
|
||||||
import { useDocumentTitle } from "@/hooks/use-document-title"
|
import { useDocumentTitle } from "@/hooks/use-document-title"
|
||||||
import type { DiaryEntryDto } from "@/lib/api/common"
|
import type { DiaryEntryDto } from "@/lib/api/common"
|
||||||
@@ -31,10 +32,11 @@ function groupByDate(items: DiaryEntryDto[]) {
|
|||||||
|
|
||||||
function DiaryPage() {
|
function DiaryPage() {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
const { auth } = useAuth()
|
||||||
useDocumentTitle(t("diary.title"))
|
useDocumentTitle(t("diary.title"))
|
||||||
const [month, setMonth] = useState(() => startOfMonth(new Date()))
|
const [month, setMonth] = useState(() => startOfMonth(new Date()))
|
||||||
const { data, isPending, hasNextPage, isFetchingNextPage, fetchNextPage } =
|
const { data, isPending, hasNextPage, isFetchingNextPage, fetchNextPage } =
|
||||||
useInfiniteDiary({ sort_by: "desc" })
|
useInfiniteDiary({ sort_by: "desc", user_id: auth?.user_id })
|
||||||
const deleteReview = useDeleteReview()
|
const deleteReview = useDeleteReview()
|
||||||
const [editingEntry, setEditingEntry] = useState<DiaryEntryDto | null>(null)
|
const [editingEntry, setEditingEntry] = useState<DiaryEntryDto | null>(null)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user