diff --git a/src/index.ts b/src/index.ts index 53446b5..8257393 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,19 +29,9 @@ app.get("/api/v1/ext/query_all", (c) => { }); app.get("/api/v1/ext/query_necessary", (c) => { - // Python code fetches all columns then filters via Pydantic model. - // We can select just what we need or select all and map. - // Let's select all to be consistent with the 'all()' behavior if logic changes, - // but map to the response shape to respect the 'response_model'. - const query = db.query("SELECT * FROM extensions"); - const extensions = query.all() as ExtensionInDB[]; - - const necessary: ExtensionNecessary[] = extensions.map((ext) => ({ - ID: ext.ID, - SAFE: ext.SAFE, - })); - - return c.json(necessary); + const query = db.query("SELECT ID, SAFE FROM extensions"); + const extensions = query.all() as ExtensionNecessary[]; + return c.json(extensions); }); app.post("/api/v1/ext/add_one", async (c) => {