chore: Update package version to 0.3.51 and improve connection handling in API route
This commit is contained in:
parent
6b624af4d0
commit
877eea8ebe
3 changed files with 4 additions and 2 deletions
|
|
@ -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 });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue