diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-12-07 19:16:48 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-12-07 19:16:48 +0900 |
| commit | fe101104cdd50256d4ef5c61e1bf099ed2da68e3 (patch) | |
| tree | 862d84bd685dcbea6fe1bb2fc02f1cad33049196 /src/client | |
| parent | c086c8b35b6c6f0b0e2623e9b6421713a540941a (diff) | |
| download | kioku-fe101104cdd50256d4ef5c61e1bf099ed2da68e3.tar.gz kioku-fe101104cdd50256d4ef5c61e1bf099ed2da68e3.tar.zst kioku-fe101104cdd50256d4ef5c61e1bf099ed2da68e3.zip | |
feat(server): add POST /api/sync/push endpoint
Implement sync push endpoint with Last-Write-Wins conflict resolution.
Includes Zod validation for decks, cards, and review logs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/pages/StudyPage.tsx | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/client/pages/StudyPage.tsx b/src/client/pages/StudyPage.tsx index 05e9943..c6f8665 100644 --- a/src/client/pages/StudyPage.tsx +++ b/src/client/pages/StudyPage.tsx @@ -144,17 +144,14 @@ export function StudyPage() { throw new ApiClientError("Not authenticated", 401); } - const res = await fetch( - `/api/decks/${deckId}/study/${currentCard.id}`, - { - method: "POST", - headers: { - ...authHeader, - "Content-Type": "application/json", - }, - body: JSON.stringify({ rating, durationMs }), + const res = await fetch(`/api/decks/${deckId}/study/${currentCard.id}`, { + method: "POST", + headers: { + ...authHeader, + "Content-Type": "application/json", }, - ); + body: JSON.stringify({ rating, durationMs }), + }); if (!res.ok) { const errorBody = await res.json().catch(() => ({})); @@ -312,7 +309,13 @@ export function StudyPage() { <strong data-testid="completed-count">{completedCount}</strong>{" "} card{completedCount !== 1 ? "s" : ""}. </p> - <div style={{ display: "flex", gap: "1rem", justifyContent: "center" }}> + <div + style={{ + display: "flex", + gap: "1rem", + justifyContent: "center", + }} + > <Link href={`/decks/${deckId}`}> <button type="button">Back to Deck</button> </Link> @@ -336,7 +339,9 @@ export function StudyPage() { }} role="button" tabIndex={0} - aria-label={isFlipped ? "Card showing answer" : "Click to reveal answer"} + aria-label={ + isFlipped ? "Card showing answer" : "Click to reveal answer" + } style={{ border: "1px solid #ccc", borderRadius: "8px", |
