Changeset 9d34855 in Klonkt for src/routes
- Timestamp:
- 06/26/2026 11:50:14 PM (2 months ago)
- Branches:
- main
- Children:
- 0a75356
- Parents:
- c7ecaf9
- File:
-
- 1 edited
-
src/routes/posts.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/posts.js
rc7ecaf9 r9d34855 695 695 router.post('/news/like', requireSiteManager, async (req, res) => { 696 696 const site = res.locals.site; 697 if (site) { try { await ActivityPubService.sendInteraction(site, 'like', (req.body.note || '').toString(), (req.body.author || '').toString()); } catch (e) { /* ignore */ } } 697 const note = (req.body.note || '').toString(); 698 if (site && note) { 699 try { await ActivityPubService.sendInteraction(site, 'like', note, (req.body.author || '').toString()); } catch (e) { /* ignore */ } 700 ActivityPubService.markLiked(site.slug, note); 701 } 698 702 res.redirect('/news?success=' + encodeURIComponent('Geliket ⭐')); 703 }); 704 705 router.post('/news/unlike', requireSiteManager, async (req, res) => { 706 const site = res.locals.site; 707 const note = (req.body.note || '').toString(); 708 if (site && note) { 709 try { await ActivityPubService.sendInteraction(site, 'unlike', note, (req.body.author || '').toString()); } catch (e) { /* ignore */ } 710 ActivityPubService.unmarkLiked(site.slug, note); 711 } 712 res.redirect('/news?success=' + encodeURIComponent('Like ingetrokken')); 699 713 }); 700 714
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)