From 877eea8ebec0bcfaee1db5227f9a22ea7b6d87d7 Mon Sep 17 00:00:00 2001 From: decolua Date: Sat, 14 Mar 2026 11:56:29 +0700 Subject: [PATCH] chore: Update package version to 0.3.51 and improve connection handling in API route --- open-sse/utils/proxyFetch.js | 1 + package.json | 2 +- src/app/api/usage/[connectionId]/route.js | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/open-sse/utils/proxyFetch.js b/open-sse/utils/proxyFetch.js index 05bb36a..23dbdd1 100644 --- a/open-sse/utils/proxyFetch.js +++ b/open-sse/utils/proxyFetch.js @@ -1,3 +1,4 @@ +import { Readable } from "stream"; import { MEMORY_CONFIG } from "../config/runtimeConfig.js"; const isCloud = typeof caches !== "undefined" && typeof caches === "object"; diff --git a/package.json b/package.json index a7dd8a7..2b8373d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "9router-app", - "version": "0.3.49", + "version": "0.3.51", "description": "9Router web dashboard", "private": true, "scripts": { diff --git a/src/app/api/usage/[connectionId]/route.js b/src/app/api/usage/[connectionId]/route.js index 29cf245..adf6138 100644 --- a/src/app/api/usage/[connectionId]/route.js +++ b/src/app/api/usage/[connectionId]/route.js @@ -91,11 +91,12 @@ async function refreshAndUpdateCredentials(connection) { * GET /api/usage/[connectionId] - Get usage data for a specific connection */ export async function GET(request, { params }) { + let connection; try { const { connectionId } = await params; // Get connection from database - let connection = await getProviderConnectionById(connectionId); + connection = await getProviderConnectionById(connectionId); if (!connection) { return Response.json({ error: "Connection not found" }, { status: 404 }); }