fix: persist filters when refetching boards

This commit is contained in:
Henry
2024-09-27 14:27:17 +01:00
parent 028239d63b
commit f1dfe8fb00
4 changed files with 4 additions and 17 deletions

View File

@@ -54,14 +54,7 @@ export const BoardProvider: React.FC<{ children: ReactNode }> = ({
if (!boardData?.publicId) return;
try {
const data = await utils.board.byId.fetch({
boardPublicId: boardData.publicId,
filters: {
members: [],
labels: [],
},
});
if (data) setBoardData(data);
await utils.board.byId.refetch();
} catch (e) {
showPopup({
header: "Error fetching board",

View File

@@ -18,13 +18,7 @@ export function DeleteListConfirmation({
const refetchBoard = async () => {
if (boardData?.publicId) {
try {
await utils.board.byId.refetch({
boardPublicId: boardData.publicId,
filters: {
members: [],
labels: [],
},
});
await utils.board.byId.refetch();
} catch (e) {
console.error(e);
}

View File

@@ -64,7 +64,7 @@ export default function List({
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
className="dark-text-dark-1000 z-0 mr-5 h-fit min-w-[18rem] max-w-[18rem] rounded-md border border-light-400 bg-light-300 py-2 pl-2 pr-1 text-neutral-900 dark:border-dark-300 dark:bg-dark-100"
className="dark-text-dark-1000 mr-5 h-fit min-w-[18rem] max-w-[18rem] rounded-md border border-light-400 bg-light-300 py-2 pl-2 pr-1 text-neutral-900 dark:border-dark-300 dark:bg-dark-100"
>
<div className="flex justify-between">
<form

View File

@@ -218,7 +218,7 @@ export default function BoardPage() {
<div
ref={provided.innerRef}
{...provided.droppableProps}
className="h-full max-h-[calc(100vh-250px)] min-h-[2rem] overflow-y-auto pr-1 scrollbar scrollbar-track-dark-100 scrollbar-thumb-dark-600 scrollbar-track-rounded-[4px] scrollbar-thumb-rounded-[4px] scrollbar-w-[8px]"
className="z-10 h-full max-h-[calc(100vh-250px)] min-h-[2rem] overflow-y-auto pr-1 scrollbar scrollbar-track-dark-100 scrollbar-thumb-dark-600 scrollbar-track-rounded-[4px] scrollbar-thumb-rounded-[4px] scrollbar-w-[8px]"
>
{list.cards?.map((card, index) => (
<Draggable