fix: reenable switching lists from list dropdown

This commit is contained in:
Henry
2025-05-27 22:00:20 +01:00
parent 59eadfc694
commit b07e473745

View File

@@ -23,7 +23,7 @@ export default function ListSelector({
const { showPopup } = usePopup(); const { showPopup } = usePopup();
const updateCardList = api.card.reorder.useMutation({ const updateCardList = api.card.update.useMutation({
onMutate: async (newList) => { onMutate: async (newList) => {
await utils.card.byId.cancel(); await utils.card.byId.cancel();
@@ -36,9 +36,9 @@ export default function ListSelector({
...oldCard, ...oldCard,
list: { list: {
...oldCard.list, ...oldCard.list,
publicId: newList.newListPublicId, publicId: newList.listPublicId ?? "",
name: oldCard.list?.name ?? "", name: oldCard.list.name ?? "",
board: oldCard.list?.board ?? null, board: oldCard.list.board ?? null,
}, },
}; };
}); });
@@ -72,7 +72,8 @@ export default function ListSelector({
handleSelect={(_, member) => { handleSelect={(_, member) => {
updateCardList.mutate({ updateCardList.mutate({
cardPublicId, cardPublicId,
newListPublicId: member.key, listPublicId: member.key,
index: 0,
}); });
}} }}
asChild asChild