Skip to content

Commit ba83312

Browse files
authored
Remove hardcoded dynamic routes (#1145)
* remove hardcoded dynamic routes * cleanup searchParams
1 parent 7a4b0a2 commit ba83312

File tree

11 files changed

+3
-28
lines changed

11 files changed

+3
-28
lines changed

apps/web/app/(org)/dashboard/caps/page.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,18 @@ async function getSharedSpacesForVideos(videoIds: Video.VideoId[]) {
9696
return sharedSpacesMap;
9797
}
9898

99-
export default async function CapsPage(props: {
100-
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
101-
}) {
99+
export default async function CapsPage(props: PageProps<"/dashboard/caps">) {
102100
const searchParams = await props.searchParams;
103101
const user = await getCurrentUser();
104102

105103
if (!user || !user.id) {
106104
redirect("/login");
107105
}
108106

109-
const userId = user.id;
110107
const page = Number(searchParams.page) || 1;
111108
const limit = Number(searchParams.limit) || 15;
109+
110+
const userId = user.id;
112111
const offset = (page - 1) * limit;
113112

114113
const totalCountResult = await db()

apps/web/app/(org)/layout.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import type { PropsWithChildren } from "react";
22
import { Intercom } from "../Layout/Intercom";
33

4-
export const revalidate = 0;
5-
64
export default function Layout(props: PropsWithChildren) {
75
return (
86
<>

apps/web/app/(site)/download/[platform]/route.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import { type NextRequest, NextResponse } from "next/server";
22

33
export const runtime = "edge";
44

5-
// Disable caching to ensure users always get the latest download URL
6-
export const revalidate = 0;
7-
85
export async function GET(
96
request: NextRequest,
107
props: { params: Promise<{ platform: string }> },

apps/web/app/api/changelog/status/route.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { NextResponse } from "next/server";
22
import { getChangelogPosts } from "../../../../utils/changelog";
33

4-
export const revalidate = 0;
5-
64
export async function GET(request: Request) {
75
const { searchParams } = new URL(request.url);
86
const version = searchParams.get("version");

apps/web/app/api/download/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { type NextRequest, NextResponse } from "next/server";
22

33
export const runtime = "edge";
4-
export const revalidate = 0;
54

65
export async function GET(request: NextRequest) {
76
const userAgent = request.headers.get("user-agent") || "";

apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ const octokit = new Octokit();
44

55
export const runtime = "edge";
66

7-
export const revalidate = 0;
8-
97
export async function GET(
108
req: Request,
119
props: RouteContext<"/api/releases/tauri/[version]/[target]/[arch]">,

apps/web/app/api/status/route.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export const revalidate = 0;
2-
31
export async function GET() {
42
return new Response("OK", {
53
status: 200,

apps/web/app/api/thumbnail/route.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import type { NextRequest } from "next/server";
88
import { runPromise } from "@/lib/server";
99
import { getHeaders } from "@/utils/helpers";
1010

11-
export const revalidate = 0;
12-
1311
export async function GET(request: NextRequest) {
1412
const { searchParams } = request.nextUrl;
1513
const videoId = searchParams.get("videoId");

apps/web/app/embed/[videoId]/page.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ import { isAiGenerationEnabled } from "@/utils/flags";
2323
import { EmbedVideo } from "./_components/EmbedVideo";
2424
import { PasswordOverlay } from "./_components/PasswordOverlay";
2525

26-
export const dynamic = "auto";
27-
export const dynamicParams = true;
28-
export const revalidate = 30;
29-
3026
export async function generateMetadata(
3127
props: PageProps<"/embed/[videoId]">,
3228
): Promise<Metadata> {

apps/web/app/robots.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import type { MetadataRoute } from "next";
22
import { headers, type UnsafeUnwrappedHeaders } from "next/headers";
33
import { seoPages } from "@/lib/seo-pages";
44

5-
export const revalidate = 0;
6-
75
export default function robots(): MetadataRoute.Robots {
86
const seoPageSlugs = Object.keys(seoPages);
97
const headersList = headers() as unknown as UnsafeUnwrappedHeaders;

0 commit comments

Comments
 (0)