Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ export async function POST(
req: Request,
props: {
params: Promise<{ linkId: string }>;
}
},
) {
const params = await props.params;

const {
linkId
} = params;
const { linkId } = params;

try {
const rawBody = await req.text();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { NextResponse } from "next/server";
import { campaigns } from "../campaigns";

export async function GET(request: Request, props: { params: Promise<{ campaignId: string }> }) {
export async function GET(
request: Request,
props: { params: Promise<{ campaignId: string }> },
) {
const params = await props.params;
const { campaignId } = params;

Expand Down
16 changes: 7 additions & 9 deletions apps/web/app/(ee)/app.dub.co/embed/referrals/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import { ReferralsEmbedPageClient } from "./page-client";
import { parseThemeOptions, ThemeOptions } from "./theme-options";
import { getReferralsEmbedData } from "./utils";

export default async function ReferralsEmbedPage(
props: {
searchParams: Promise<{
token: string;
themeOptions?: string;
dynamicHeight?: string;
}>;
}
) {
export default async function ReferralsEmbedPage(props: {
searchParams: Promise<{
token: string;
themeOptions?: string;
dynamicHeight?: string;
}>;
}) {
const searchParams = await props.searchParams;
const {
token,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/(ee)/app.dub.co/embed/referrals/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { serializeReward } from "@/lib/api/partners/serialize-reward";
import { getProgramEnrollmentOrThrow } from "@/lib/api/programs/get-program-enrollment-or-throw";
import { referralsEmbedToken } from "@/lib/embed/referrals/token-class";
import { aggregatePartnerLinksStats } from "@/lib/partners/aggregate-partner-links-stats";
import { serializeReward } from "@/lib/api/partners/serialize-reward";
import { PartnerGroupProps } from "@/lib/types";
import { ReferralsEmbedLinkSchema } from "@/lib/zod/schemas/referrals-embed";
import { prisma } from "@dub/prisma";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ interface Props {
export default async function ResetPasswordPage(props: Props) {
const params = await props.params;

const {
token
} = params;
const { token } = params;

const validToken = await isValidToken(token);

Expand Down
12 changes: 4 additions & 8 deletions apps/web/app/(ee)/partners.dub.co/(auth)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import RegisterPageClient from "./page-client";

export default async function RegisterPage(
props: {
params: Promise<{ programSlug?: string }>;
}
) {
export default async function RegisterPage(props: {
params: Promise<{ programSlug?: string }>;
}) {
const params = await props.params;

const {
programSlug
} = params;
const { programSlug } = params;

if (programSlug === "framer") {
redirect("/framer/login");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,24 @@ async function OnlinePresenceFormRSC() {
country={partner.country}
partner={{
...partner,
...(application?.website && !partner.website ? { website: application?.website } : {}),
...(application?.tiktok && !partner.tiktok ? { tiktok: application?.tiktok } : {}),
...(application?.youtube && !partner.youtube ? { youtube: application?.youtube } : {}),
...(application?.twitter && !partner.twitter ? { twitter: application?.twitter } : {}),
...(application?.linkedin && !partner.linkedin ? { linkedin: application?.linkedin } : {}),
...(application?.instagram && !partner.instagram ? { instagram: application?.instagram } : {}),
...(application?.website && !partner.website
? { website: application?.website }
: {}),
...(application?.tiktok && !partner.tiktok
? { tiktok: application?.tiktok }
: {}),
...(application?.youtube && !partner.youtube
? { youtube: application?.youtube }
: {}),
...(application?.twitter && !partner.twitter
? { twitter: application?.twitter }
: {}),
...(application?.linkedin && !partner.linkedin
? { linkedin: application?.linkedin }
: {}),
...(application?.instagram && !partner.instagram
? { instagram: application?.instagram }
: {}),
}}
/>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { redirect } from "next/navigation";

export default async function OldApplyPage(
props: {
params: Promise<{ programSlug: string; slug: string[] }>;
}
) {
export default async function OldApplyPage(props: {
params: Promise<{ programSlug: string; slug: string[] }>;
}) {
const params = await props.params;
const { programSlug, slug } = params;
if (slug && slug.includes("application")) {
Expand Down
8 changes: 3 additions & 5 deletions apps/web/app/[domain]/not-found/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ const UTM_PARAMS = {
utm_medium: "Link Not Found Page",
};

export default async function NotFoundLinkPage(
props: {
params: Promise<{ domain: string }>;
}
) {
export default async function NotFoundLinkPage(props: {
params: Promise<{ domain: string }>;
}) {
const params = await props.params;
return (
<main className="flex min-h-screen flex-col justify-between">
Expand Down
4 changes: 3 additions & 1 deletion apps/web/app/[domain]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import PlaceholderContent from "./placeholder";

export const revalidate = false; // cache indefinitely

export async function generateMetadata(props: { params: Promise<{ domain: string }> }) {
export async function generateMetadata(props: {
params: Promise<{ domain: string }>;
}) {
const params = await props.params;
const title = `${params.domain.toUpperCase()} - A ${
process.env.NEXT_PUBLIC_APP_NAME
Expand Down
8 changes: 3 additions & 5 deletions apps/web/app/[domain]/stats/[key]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import { redirect } from "next/navigation";

export const runtime = "edge";

export default async function OldStatsPage(
props: {
params: Promise<{ domain: string; key: string }>;
}
) {
export default async function OldStatsPage(props: {
params: Promise<{ domain: string; key: string }>;
}) {
const params = await props.params;
const link = await prismaEdge.link.findUnique({
where: {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/api/links/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DubApiError, ErrorCodes } from "@/lib/api/errors";
import { createLink, getLinksForWorkspace, processLink } from "@/lib/api/links";
import { validateLinksQueryFilters } from "@/lib/api/links/validate-links-query-filters";
import { throwIfLinksUsageExceeded } from "@/lib/api/links/usage-checks";
import { validateLinksQueryFilters } from "@/lib/api/links/validate-links-query-filters";
import { parseRequestBody } from "@/lib/api/utils";
import { withWorkspace } from "@/lib/auth";
import { ratelimit } from "@/lib/upstash";
Expand Down
5 changes: 4 additions & 1 deletion apps/web/app/api/og/avatar/[[...seed]]/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { getTheme } from "./utils";

export const runtime = "edge";

export async function GET(req: NextRequest, props: { params: Promise<{ seed?: string[] }> }) {
export async function GET(
req: NextRequest,
props: { params: Promise<{ seed?: string[] }> },
) {
const params = await props.params;
const origin = req.headers.get("origin");
// Validate the origin header and set CORS headers accordingly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ interface Props {
export default async function ResetPasswordPage(props: Props) {
const params = await props.params;

const {
token
} = params;
const { token } = params;

const validToken = await isValidToken(token);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ export function CampaignTypeIcon({
</div>
);
}

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import { PageContent } from "@/ui/layout/page-content";
import { PageWidthWrapper } from "@/ui/layout/page-width-wrapper";
import { ProgramPartnersRejectedApplicationsPageClient } from "./page-client";

export default async function ProgramPartnersRejectedApplications(
props: {
params: Promise<{ slug: string }>;
}
) {
export default async function ProgramPartnersRejectedApplications(props: {
params: Promise<{ slug: string }>;
}) {
const params = await props.params;
return (
<PageContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import { PageContent } from "@/ui/layout/page-content";
import { PageWidthWrapper } from "@/ui/layout/page-width-wrapper";
import { FolderMembersPageClient } from "./page-client";

export default async function FolderMembersPage(
props: {
params: Promise<{ folderId: string }>;
}
) {
export default async function FolderMembersPage(props: {
params: Promise<{ folderId: string }>;
}) {
const params = await props.params;
const { folderId } = params;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import { redirect } from "next/navigation";

export const revalidate = 0;

export default async function IntegrationManagePage(
props: {
params: Promise<{ slug: string; integrationSlug: string }>;
}
) {
export default async function IntegrationManagePage(props: {
params: Promise<{ slug: string; integrationSlug: string }>;
}) {
const params = await props.params;
// this is only available for Dub workspace for now
// we might open this up to other workspaces in the future
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import IntegrationPageClient from "./page-client";

export const revalidate = 0;

export default async function IntegrationPage(
props: {
params: Promise<{ slug: string; integrationSlug: string }>;
}
) {
export default async function IntegrationPage(props: {
params: Promise<{ slug: string; integrationSlug: string }>;
}) {
const params = await props.params;
const integration = await prisma.integration.findUnique({
where: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ import { Suspense } from "react";
export const dynamic = "force-dynamic";
export const revalidate = 0;

export default async function EnabledIntegrationsPage(
props: {
params: Promise<{ slug: string }>;
}
) {
export default async function EnabledIntegrationsPage(props: {
params: Promise<{ slug: string }>;
}) {
const params = await props.params;
return (
<div className="mx-auto flex w-full max-w-screen-md flex-col gap-8">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import { BackLink } from "@/ui/shared/back-link";
import { MaxWidthWrapper } from "@dub/ui";
import { redirect } from "next/navigation";

export default async function NewIntegrationsPage(
props: {
params: Promise<{ slug: string }>;
}
) {
export default async function NewIntegrationsPage(props: {
params: Promise<{ slug: string }>;
}) {
const params = await props.params;
// this is only available for Dub workspace for now
// we might open this up to other workspaces in the future
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import OAuthAppManagePageClient from "./page-client";

export default async function OAuthAppManagePage(
props: {
params: Promise<{ appId: string }>;
}
) {
export default async function OAuthAppManagePage(props: {
params: Promise<{ appId: string }>;
}) {
const params = await props.params;
const { appId } = params;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import UpdateWebhookPageClient from "./page-client";

export default async function UpdateWebhookPage(
props: {
params: Promise<{ webhookId: string }>;
}
) {
export default async function UpdateWebhookPage(props: {
params: Promise<{ webhookId: string }>;
}) {
const params = await props.params;
const { webhookId } = params;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import WebhookHeader from "@/ui/webhooks/webhook-header";
import { ReactNode } from "react";

export default async function WebhookLayout(
props: {
params: Promise<{ webhookId: string }>;
children: ReactNode;
}
) {
export default async function WebhookLayout(props: {
params: Promise<{ webhookId: string }>;
children: ReactNode;
}) {
const params = await props.params;

const {
children
} = props;
const { children } = props;

return (
<div className="max-w-screen grid gap-4">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import WebhookEventsPageClient from "./page-client";

export default async function WebhookEventsPage(
props: {
params: Promise<{ webhookId: string }>;
}
) {
export default async function WebhookEventsPage(props: {
params: Promise<{ webhookId: string }>;
}) {
const params = await props.params;
const { webhookId } = params;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import { redirect } from "next/navigation";
import { DeepLinkActionButtons } from "./action-buttons";
import { BrandLogoBadge } from "./brand-logo-badge";

export default async function DeepLinkPreviewPage(
props: {
params: Promise<{ domain: string; key: string }>;
}
) {
export default async function DeepLinkPreviewPage(props: {
params: Promise<{ domain: string; key: string }>;
}) {
const params = await props.params;
const domain = params.domain;
const key = decodeURIComponent(params.key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import Link from "next/link";
import { redirect } from "next/navigation";
import WrappedPageClient from "./client";

export default async function WrappedPage(
props: {
params: Promise<{ slug: string; year: string }>;
}
) {
export default async function WrappedPage(props: {
params: Promise<{ slug: string; year: string }>;
}) {
const params = await props.params;
if (params.year !== "2024") {
redirect(`/${params.slug}`);
Expand Down
Loading