chore: pages endpoint updated (#1137)

This commit is contained in:
Anmol Singh Bhatia 2023-05-26 15:38:44 +05:30 committed by GitHub
parent 11b28048bf
commit 4ce0ac6ea1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 39 deletions

View file

@ -18,7 +18,10 @@ export const AllPagesList: React.FC<TPagesListProps> = ({ viewType }) => {
const { data: pages } = useSWR(
workspaceSlug && projectId ? ALL_PAGES_LIST(projectId as string) : null,
workspaceSlug && projectId
? () => pagesService.getAllPages(workspaceSlug as string, projectId as string)
? () =>
pagesService.getPagesWithParams(workspaceSlug as string, projectId as string, {
page_view: "all",
})
: null
);

View file

@ -18,7 +18,10 @@ export const FavoritePagesList: React.FC<TPagesListProps> = ({ viewType }) => {
const { data: pages } = useSWR(
workspaceSlug && projectId ? FAVORITE_PAGES_LIST(projectId as string) : null,
workspaceSlug && projectId
? () => pagesService.getFavoritePages(workspaceSlug as string, projectId as string)
? () =>
pagesService.getPagesWithParams(workspaceSlug as string, projectId as string, {
page_view: "favorite",
})
: null
);

View file

@ -18,7 +18,10 @@ export const MyPagesList: React.FC<TPagesListProps> = ({ viewType }) => {
const { data: pages } = useSWR(
workspaceSlug && projectId ? MY_PAGES_LIST(projectId as string) : null,
workspaceSlug && projectId
? () => pagesService.getMyPages(workspaceSlug as string, projectId as string)
? () =>
pagesService.getPagesWithParams(workspaceSlug as string, projectId as string, {
page_view: "created_by_me",
})
: null
);

View file

@ -18,7 +18,10 @@ export const OtherPagesList: React.FC<TPagesListProps> = ({ viewType }) => {
const { data: pages } = useSWR(
workspaceSlug && projectId ? OTHER_PAGES_LIST(projectId as string) : null,
workspaceSlug && projectId
? () => pagesService.getOtherPages(workspaceSlug as string, projectId as string)
? () =>
pagesService.getPagesWithParams(workspaceSlug as string, projectId as string, {
page_view: "created_by_other",
})
: null
);