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[]>(
ALL_PAGES_LIST(projectId as string),
(prevData) => (prevData ?? []).map((p) => ({ ...p, ...formData })),
(prevData) => (prevData ?? []).map((p) => ({ ...p, ...(p.id === page.id ? formData : {}) })),
false
);
mutate<IPage[]>(
MY_PAGES_LIST(projectId as string),
(prevData) => (prevData ?? []).map((p) => ({ ...p, ...formData })),
(prevData) => (prevData ?? []).map((p) => ({ ...p, ...(p.id === page.id ? formData : {}) })),
false
);
mutate<IPage[]>(
FAVORITE_PAGES_LIST(projectId as string),
(prevData) => (prevData ?? []).map((p) => ({ ...p, ...formData })),
(prevData) => (prevData ?? []).map((p) => ({ ...p, ...(p.id === page.id ? formData : {}) })),
false
);
@ -217,7 +217,7 @@ export const PagesView: React.FC<Props> = ({ pages, viewType }) => {
))}
</ul>
) : 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) => (
<SinglePageDetailedItem
key={page.id}