fixed dynamic sync api

This commit is contained in:
bobbert committed 2025-03-12 20:32:45 +00:00
1 parent 95b4f9cc07
commit ab79a28528
2 files changed
+5 -4

No files matched your search

+1 -1
View File
@@ -212,7 +212,7 @@ export default function TeamPage({ params }) {
</div>
<div className="nav-bar">
<Link href="/dashboard" className="nav-item">
<Link href={`/${teamId}`} className="nav-item">
<div className="nav-icon">🏠</div>
<div className="nav-label">Home</div>
</Link>
+4 -3
View File
@@ -19,9 +19,10 @@ export async function GET(request, context) {
return Response.json({ error: "Invalid session" }, { status: 401 });
}
// Properly await the params object before accessing it
const params = context.params || {};
const teamId = params.teamId;
// FIXED: Always await context.params before accessing properties
// This approach ensures we properly handle the promise before accessing teamId
const params = await Promise.resolve(context.params);
const teamId = params?.teamId;
// Validate teamId
if (!teamId || isNaN(parseInt(teamId, 10))) {