A social knowledge tool for researchers built on ATProto
45
fork

Configure Feed

Select the types of activity you want to include in your feed.

clean up event mapper

+8 -6
+8 -6
src/shared/infrastructure/events/EventMapper.ts
··· 33 33 collectionName: string; 34 34 } 35 35 36 - export type SerializedEventUnion = 36 + export type SerializedEventUnion = 37 37 | SerializedCardAddedToLibraryEvent 38 38 | SerializedCardAddedToCollectionEvent 39 39 | SerializedCollectionCreatedEvent; ··· 92 92 } 93 93 case EventNames.CARD_ADDED_TO_COLLECTION: { 94 94 const cardId = CardId.createFromString(eventData.cardId).unwrap(); 95 - const collectionId = CollectionId.createFromString(eventData.collectionId).unwrap(); 95 + const collectionId = CollectionId.createFromString( 96 + eventData.collectionId, 97 + ).unwrap(); 96 98 const addedBy = CuratorId.create(eventData.addedBy).unwrap(); 97 99 const dateTimeOccurred = new Date(eventData.dateTimeOccurred); 98 100 ··· 104 106 ).unwrap(); 105 107 } 106 108 case EventNames.COLLECTION_CREATED: { 107 - const collectionId = CollectionId.createFromString(eventData.collectionId).unwrap(); 109 + const collectionId = CollectionId.createFromString( 110 + eventData.collectionId, 111 + ).unwrap(); 108 112 const authorId = CuratorId.create(eventData.authorId).unwrap(); 109 113 const dateTimeOccurred = new Date(eventData.dateTimeOccurred); 110 114 ··· 116 120 ).unwrap(); 117 121 } 118 122 default: 119 - throw new Error( 120 - `Unknown event type for deserialization: ${eventData.eventType}`, 121 - ); 123 + throw new Error(`Unknown event type for deserialization: ${eventData}`); 122 124 } 123 125 } 124 126 }