feat: Implement writing streak tracking, add chapter API routes, and introduce a BookSettings component with i18n support.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
Reference in New Issue
Block a user