fix: pages access mutation (#896)

This commit is contained in:
Aaryan Khandelwal 2023-04-20 12:09:55 +05:30 committed by GitHub
parent 7149d20601
commit 4f61c5d552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,17 +166,17 @@ export const PagesView: React.FC<Props> = ({ pages, viewType }) => {
mutate<IPage[]>( mutate<IPage[]>(
ALL_PAGES_LIST(projectId as string), ALL_PAGES_LIST(projectId as string),
(prevData) => (prevData ?? []).map((p) => ({ ...p, ...formData })), (prevData) => (prevData ?? []).map((p) => ({ ...p, ...(p.id === page.id ? formData : {}) })),
false false
); );
mutate<IPage[]>( mutate<IPage[]>(
MY_PAGES_LIST(projectId as string), MY_PAGES_LIST(projectId as string),
(prevData) => (prevData ?? []).map((p) => ({ ...p, ...formData })), (prevData) => (prevData ?? []).map((p) => ({ ...p, ...(p.id === page.id ? formData : {}) })),
false false
); );
mutate<IPage[]>( mutate<IPage[]>(
FAVORITE_PAGES_LIST(projectId as string), FAVORITE_PAGES_LIST(projectId as string),
(prevData) => (prevData ?? []).map((p) => ({ ...p, ...formData })), (prevData) => (prevData ?? []).map((p) => ({ ...p, ...(p.id === page.id ? formData : {}) })),
false false
); );
@ -217,7 +217,7 @@ export const PagesView: React.FC<Props> = ({ pages, viewType }) => {
))} ))}
</ul> </ul>
) : viewType === "detailed" ? ( ) : viewType === "detailed" ? (
<div className="rounded-[10px] border divide-y border-gray-200 bg-white"> <div className="divide-y rounded-[10px] border border-gray-200 bg-white">
{pages.map((page) => ( {pages.map((page) => (
<SinglePageDetailedItem <SinglePageDetailedItem
key={page.id} key={page.id}