From 352f7891588e9c33d27c2a189a414c5b4822e9fa Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 31 Dec 2025 01:10:56 +0900 Subject: feat(api): add Note API routes for CRUD operations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add REST endpoints for notes under /api/decks/:deckId/notes: - GET / - List notes in deck - POST / - Create note with auto-generated cards - GET /:noteId - Get note with field values - PUT /:noteId - Update note field values - DELETE /:noteId - Delete note and its cards (cascade) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/server/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/server/index.ts') diff --git a/src/server/index.ts b/src/server/index.ts index 91f76fb..52eab67 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -2,7 +2,15 @@ import { serve } from "@hono/node-server"; import { Hono } from "hono"; import { logger } from "hono/logger"; import { createCorsMiddleware, errorHandler } from "./middleware/index.js"; -import { auth, cards, decks, noteTypes, study, sync } from "./routes/index.js"; +import { + auth, + cards, + decks, + notes, + noteTypes, + study, + sync, +} from "./routes/index.js"; const app = new Hono(); @@ -21,6 +29,7 @@ const routes = app .route("/api/auth", auth) .route("/api/decks", decks) .route("/api/decks/:deckId/cards", cards) + .route("/api/decks/:deckId/notes", notes) .route("/api/decks/:deckId/study", study) .route("/api/note-types", noteTypes) .route("/api/sync", sync); -- cgit v1.2.3-70-g09d2