feat: Implement writing streak tracking, add chapter API routes, and introduce a BookSettings component with i18n support.

This commit is contained in:
2026-03-06 11:28:57 +01:00
parent 0c4bb60dce
commit 893560737a
9 changed files with 213 additions and 52 deletions

View File

@@ -36,6 +36,13 @@ export async function PUT(
},
});
// Update writing streak if content was explicitly updated
if (body.content !== undefined) {
import('@/lib/streak').then(({ updateWritingStreak }) => {
updateWritingStreak(session.user.id).catch(console.error);
});
}
return NextResponse.json(updated);
}

View File

@@ -34,5 +34,10 @@ export async function POST(request: NextRequest) {
},
});
// Update writing streak
import('@/lib/streak').then(({ updateWritingStreak }) => {
updateWritingStreak(session.user.id).catch(console.error);
});
return NextResponse.json(chapter, { status: 201 });
}