()
| 116 | |
| 117 | @knowledge_bp.route("/delete", methods=["POST"]) |
| 118 | def knowledge_delete(): |
| 119 | data = request.get_json(silent=True) or {} |
| 120 | category = _require_json_field(data, "category") |
| 121 | path = _require_json_field(data, "path") |
| 122 | |
| 123 | store = _get_store() |
| 124 | try: |
| 125 | store.delete(category, path) |
| 126 | except ValueError as exc: |
| 127 | raise AppError(ErrorCode.INVALID_REQUEST, str(exc)) from exc |
| 128 | except FileNotFoundError: |
| 129 | raise AppError(ErrorCode.TABLE_NOT_FOUND, "Knowledge file not found") |
| 130 | |
| 131 | return json_ok(None) |
| 132 | |
| 133 | |
| 134 | # ── search ──────────────────────────────────────────────────────────────── |
nothing calls this directly
no test coverage detected