Skip to content

Commit

Permalink
fix: keyword is not fetched correctly in API (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
howard9199 authored Dec 25, 2024
1 parent fbd1b7b commit 36d2b7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/api/session/[id]/conversations/keywords/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const GET: RequestHandler = async ({ params }) => {
// 遍歷所有群組的關鍵字
groups.forEach((group) => {
if (group.keywords) {
Object.entries(group.keywords).forEach(([, count]) => {
keywordFrequency[count] = (keywordFrequency[count] || 0) + 1;
Object.entries(group.keywords).forEach(([keyword, count]) => {
keywordFrequency[keyword] = (keywordFrequency[keyword] || 0) + count;
});
}
});
Expand Down

0 comments on commit 36d2b7f

Please sign in to comment.