A social knowledge tool for researchers built on ATProto

refactor: update cardId references to card.id and add missing import

Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>

+5 -4
+5 -4
src/webapp/features/cards/components/addCardToModal/AddCardToModal.tsx
··· 11 11 import useUpdateCardAssociations from '../../lib/mutations/useUpdateCardAssociations'; 12 12 import CollectionSelectorSkeleton from '@/features/collections/components/collectionSelector/Skeleton.CollectionSelector'; 13 13 import useAddCard from '../../lib/mutations/useAddCard'; 14 + import { SelectableCollectionItem } from '@/features/collections/types'; 14 15 15 16 interface Props { 16 17 isOpen: boolean; ··· 24 25 25 26 export default function AddCardToModal(props: Props) { 26 27 const cardStatus = useGetCardFromMyLibrary({ url: props.cardContent.url }); 27 - const isMyCard = props.cardId === cardStatus.data.cardId; 28 + const isMyCard = props.cardId === cardStatus.data.card?.id; 28 29 const [note, setNote] = useState(props.note); 29 30 const { data, error } = useMyCollections(); 30 31 ··· 58 59 const hasAdded = addedCollections.length > 0; 59 60 const hasRemoved = removedCollections.length > 0; 60 61 61 - if (cardStatus.data.cardId && !hasNoteChanged && !hasAdded && !hasRemoved) { 62 + if (cardStatus.data.card && !hasNoteChanged && !hasAdded && !hasRemoved) { 62 63 props.onClose(); 63 64 return; 64 65 } 65 66 66 67 // if the card is not in library, add it instead of updating 67 - if (!cardStatus.data.cardId) { 68 + if (!cardStatus.data.card) { 68 69 addCard.mutate( 69 70 { 70 71 url: props.cardContent.url, ··· 91 92 note?: string; 92 93 addToCollectionIds?: string[]; 93 94 removeFromCollectionIds?: string[]; 94 - } = { cardId: cardStatus.data.cardId }; 95 + } = { cardId: cardStatus.data.card!.id }; 95 96 96 97 if (hasNoteChanged) updatedCardPayload.note = trimmedNote; 97 98 if (hasAdded)