* fix comments
* fix page history
* fix aside width on smaller screens
This commit is contained in:
Philipinho
2024-04-23 22:07:00 +01:00
parent 2af1fe3c40
commit b91c3ede1e
15 changed files with 611 additions and 464 deletions

View File

@ -1,18 +1,26 @@
import { useQuery, UseQueryResult } from '@tanstack/react-query';
import { getPageHistoryById, getPageHistoryList } from '@/features/page-history/services/page-history-service';
import { IPageHistory } from '@/features/page-history/types/page.types';
import { useQuery, UseQueryResult } from "@tanstack/react-query";
import {
getPageHistoryById,
getPageHistoryList,
} from "@/features/page-history/services/page-history-service";
import { IPageHistory } from "@/features/page-history/types/page.types";
import { IPagination } from "@/lib/types.ts";
export function usePageHistoryListQuery(pageId: string): UseQueryResult<IPageHistory[], Error> {
export function usePageHistoryListQuery(
pageId: string,
): UseQueryResult<IPagination<IPageHistory>, Error> {
return useQuery({
queryKey: ['page-history-list', pageId],
queryKey: ["page-history-list", pageId],
queryFn: () => getPageHistoryList(pageId),
enabled: !!pageId,
});
}
export function usePageHistoryQuery(historyId: string): UseQueryResult<IPageHistory, Error> {
export function usePageHistoryQuery(
historyId: string,
): UseQueryResult<IPageHistory, Error> {
return useQuery({
queryKey: ['page-history', historyId],
queryKey: ["page-history", historyId],
queryFn: () => getPageHistoryById(historyId),
enabled: !!historyId,
staleTime: 10 * 60 * 1000,