Skip to content

Commit

Permalink
fix(route): Fix Discourse link (DIYgod#13167)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzx-dzx authored Aug 30, 2023
1 parent ea22ebc commit d5b1beb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/v2/discourse/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = async (ctx) => {
const response = await got(`${link}/notifications.json`, { headers: { 'User-Api-Key': key } }).json();
const items = response.notifications.map((e) => ({
title: e.fancy_title ?? e.data.badge_name,
link: `${link}/${e.data.hasOwnProperty('badge_id') ? `badges/${e.data.badge_id}/${e.data.badge_slug}?username=${e.data.username}` : `${e.topic_id}/${e.post_number}`}`,
link: `${link}/${e.data.hasOwnProperty('badge_id') ? `badges/${e.data.badge_id}/${e.data.badge_slug}?username=${e.data.username}` : `t/topic/${e.topic_id}/${e.post_number}`}`,
pubDate: new Date(e.created_at),
author: e.data.display_username ?? e.data.username,
category: `notification_type:${e.notification_type}`,
Expand Down

0 comments on commit d5b1beb

Please sign in to comment.