a tool for shared writing and social publishing
0
fork

Configure Feed

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

add some logging to appview

+14 -21
+14 -21
appview/index.ts
··· 47 47 evt.event === "sync" 48 48 ) 49 49 return; 50 + console.log(`${evt.event} in ${evt.collection}`); 50 51 if (evt.collection === ids.PubLeafletDocument) { 51 52 if (evt.event === "create" || evt.event === "update") { 52 53 let record = PubLeafletDocument.validateRecord(evt.record); 53 54 if (!record.success) { 54 - console.log(record.error); 55 55 return; 56 56 } 57 57 await supabase.from("documents").upsert({ ··· 64 64 console.log("Unauthorized to create post!"); 65 65 return; 66 66 } 67 - console.log( 68 - await supabase.from("documents_in_publications").insert({ 69 - publication: record.value.publication, 70 - document: evt.uri.toString(), 71 - }), 72 - ); 67 + await supabase.from("documents_in_publications").insert({ 68 + publication: record.value.publication, 69 + document: evt.uri.toString(), 70 + }); 73 71 } 74 72 } 75 73 if (evt.collection === ids.PubLeafletPublication) { 76 74 if (evt.event === "create" || evt.event === "update") { 77 75 let record = PubLeafletPublication.validateRecord(evt.record); 78 76 if (!record.success) return; 79 - console.log( 80 - await supabase.from("publications").upsert({ 81 - uri: evt.uri.toString(), 82 - identity_did: evt.did, 83 - name: record.value.name, 84 - }), 85 - ); 77 + await supabase.from("publications").upsert({ 78 + uri: evt.uri.toString(), 79 + identity_did: evt.did, 80 + name: record.value.name, 81 + }); 86 82 } 87 83 if (evt.event === "delete") { 88 - console.log("deleting ", evt.rkey); 89 - console.log( 90 - await supabase 91 - .from("publications") 92 - .delete() 93 - .eq("uri", evt.uri.toString()), 94 - ); 84 + await supabase 85 + .from("publications") 86 + .delete() 87 + .eq("uri", evt.uri.toString()); 95 88 } 96 89 } 97 90 if (evt.collection === ids.PubLeafletPost) {