(id: string)
| 1010 | ).toArray(); |
| 1011 | return Response.json(rows); |
| 1012 | } |
| 1013 | if (request.method === "POST" && path === "/media") { |
| 1014 | const body = (await request.json()) as { |
| 1015 | id: string; type: string; filename: string; r2_key: string; |
| 1016 | mime_type: string; size: number; width?: number; height?: number; |
| 1017 | }; |
| 1018 | this.sql.exec( |
| 1019 | `INSERT INTO media (id, type, filename, r2_key, mime_type, size, width, height) VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, |
| 1020 | body.id, body.type, body.filename, body.r2_key, body.mime_type, body.size, body.width ?? null, body.height ?? null |
no outgoing calls
no test coverage detected