Skip to content

Commit 87fab0f

Browse files
committed
fix: handle async params in changelog and feedback API routes
1 parent d6bbd51 commit 87fab0f

File tree

9 files changed

+20
-18
lines changed

9 files changed

+20
-18
lines changed

apps/web/app/api/changelog/[id]/route.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { api } from "@repo/backend/convex/_generated/api";
22
import { ProjectId } from "@/lib/types";
33
import { fetchQuery } from "convex/nextjs";
44

5-
export async function GET(_: Request, context: { params: ProjectId }) {
5+
export async function GET(_: Request, context: { params: Promise<ProjectId> }) {
6+
const id = (await context.params).id;
7+
68
try {
79
const changelogs = await fetchQuery(api.changelog.list, {
8-
projectId: context.params.id,
10+
projectId: id,
911
showPublished: true,
1012
});
1113

apps/web/app/api/feedback/[id]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import { api } from "@repo/backend/convex/_generated/api";
22
import { ProjectId } from "@/lib/types";
33
import { fetchQuery } from "convex/nextjs";
44

5-
export async function GET(_: Request, context: { params: ProjectId }) {
5+
export async function GET(_: Request, context: { params: Promise<ProjectId> }) {
6+
const id = (await context.params).id;
67
try {
78
const feedbacks = await fetchQuery(api.feedback.list, {
8-
projectId: context.params.id,
9+
projectId: id,
910
});
1011

1112
return Response.json({

apps/web/app/api/webhooks/clerk/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export async function POST(req: Request) {
2020
}
2121

2222
// Get the headers
23-
const headerPayload = headers();
23+
const headerPayload = await headers();
2424
const svix_id = headerPayload.get("svix-id");
2525
const svix_timestamp = headerPayload.get("svix-timestamp");
2626
const svix_signature = headerPayload.get("svix-signature");

apps/web/app/api/webhooks/clerk/utils/organization.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ function mapOrgJsonToOrg(orgJson: OrganizationJSON): Organization {
3434
clerkId: orgJson.id,
3535
name: orgJson.name,
3636
imageUrl: orgJson.image_url || "",
37-
createdBy: orgJson.created_by,
37+
createdBy: orgJson.created_by || "",
3838
};
3939
}

apps/web/components/theme/theme-provider.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"use client"
22

33
import * as React from "react"
4-
import { ThemeProvider as NextThemesProvider } from "next-themes"
5-
import { type ThemeProviderProps } from "next-themes/dist/types"
4+
import { ThemeProvider as NextThemesProvider, type ThemeProviderProps } from "next-themes"
65

76
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
87
return <NextThemesProvider {...props}>{children}</NextThemesProvider>

apps/web/components/ui/drawer.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ const Drawer = ({
1616
)
1717
Drawer.displayName = "Drawer"
1818

19-
const DrawerTrigger = DrawerPrimitive.Trigger
19+
const DrawerTrigger: typeof DrawerPrimitive.Trigger = DrawerPrimitive.Trigger
2020

2121
const DrawerPortal = DrawerPrimitive.Portal
2222

23-
const DrawerClose = DrawerPrimitive.Close
23+
const DrawerClose: typeof DrawerPrimitive.Close = DrawerPrimitive.Close
2424

2525
const DrawerOverlay = React.forwardRef<
2626
React.ElementRef<typeof DrawerPrimitive.Overlay>,
@@ -31,7 +31,7 @@ const DrawerOverlay = React.forwardRef<
3131
className={cn("fixed inset-0 z-50 bg-black/80", className)}
3232
{...props}
3333
/>
34-
))
34+
)) as React.FC<React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>>
3535
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName
3636

3737
const DrawerContent = React.forwardRef<
@@ -52,7 +52,7 @@ const DrawerContent = React.forwardRef<
5252
{children}
5353
</DrawerPrimitive.Content>
5454
</DrawerPortal>
55-
))
55+
))as React.FC<React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>>
5656
DrawerContent.displayName = "DrawerContent"
5757

5858
const DrawerHeader = ({
@@ -89,7 +89,7 @@ const DrawerTitle = React.forwardRef<
8989
)}
9090
{...props}
9191
/>
92-
))
92+
))as React.FC<React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>>
9393
DrawerTitle.displayName = DrawerPrimitive.Title.displayName
9494

9595
const DrawerDescription = React.forwardRef<
@@ -101,7 +101,7 @@ const DrawerDescription = React.forwardRef<
101101
className={cn("text-sm text-muted-foreground", className)}
102102
{...props}
103103
/>
104-
))
104+
))as React.FC<React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>>
105105
DrawerDescription.displayName = DrawerPrimitive.Description.displayName
106106

107107
export {

apps/web/lib/hooks/use-event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function useEvent<TCallback extends AnyFunction>(
3636

3737
// Create a stable callback that always calls the latest callback:
3838
// using useRef instead of useCallback avoids creating and empty array on every render
39-
const stableRef = useRef<TCallback>();
39+
const stableRef = useRef<TCallback | null>(null);
4040
if (!stableRef.current) {
4141
// eslint-disable-next-line no-unused-vars
4242
stableRef.current = function (this: unknown) {

apps/web/next.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ module.exports = withSentryConfig(
4848
sentryUrl: "https://sentry.io/",
4949

5050
// Only print logs for uploading source maps in CI
51-
// eslint-disable-next-line turbo/no-undeclared-env-vars
5251
silent: !process.env.CI,
5352

5453
// For all available options, see:

turbo.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
"NEXT_PUBLIC_SENTRY_DSN",
1212
"KAFKA_BROKER",
1313
"KAFKA_USERNAME",
14-
"KAFKA_PASSWORD"
14+
"KAFKA_PASSWORD",
15+
"CI"
1516
],
1617
"tasks": {
1718
"build": {
1819
"dependsOn": ["^build"],
1920
"inputs": ["$TURBO_DEFAULT$", ".env*"],
20-
"outputs": [".next/**", "!.next/cache/**"]
21+
"outputs": [".next/**", "!.next/cache/**" , "dist/**"]
2122
},
2223
"lint": {
2324
"dependsOn": ["^lint"]

0 commit comments

Comments
 (0)