fix: fix type errors when building the website
This commit is contained in:
parent
d4d040f9cb
commit
dcaa81707b
3 changed files with 6 additions and 9 deletions
|
@ -1,16 +1,12 @@
|
|||
import React from "react";
|
||||
export async function generateMetadata({
|
||||
searchParams
|
||||
}: {
|
||||
searchParams: { id: string } | undefined;
|
||||
}) {
|
||||
export async function generateMetadata() {
|
||||
return {
|
||||
title: "Unsubscribe - SVR.JS",
|
||||
description: "Unsubscribe from our newsletter.",
|
||||
openGraph: {
|
||||
title: "Unsubscribe - SVR.JS",
|
||||
description: "Unsubscribe from our newsletter.",
|
||||
url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/unsubscribe/?id=${encodeURIComponent(searchParams ? searchParams.id : "")}`,
|
||||
url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/unsubscribe?id=`, // We can't use searchParams in layouts
|
||||
type: "website",
|
||||
images: [
|
||||
{
|
||||
|
|
|
@ -16,14 +16,15 @@ export async function POST(req: NextRequest) {
|
|||
};
|
||||
|
||||
const generateUniqueUnsubscribeID = async (collection: Collection) => {
|
||||
const id = generateUnsubscribeID();
|
||||
const id: string = generateUnsubscribeID();
|
||||
const result = await collection
|
||||
.find({
|
||||
unsubscribeId: id
|
||||
})
|
||||
.toArray();
|
||||
if (result.length > 0) {
|
||||
return await generateUniqueUnsubscribeID(collection);
|
||||
const newId: string = await generateUniqueUnsubscribeID(collection);
|
||||
return newId;
|
||||
}
|
||||
return id;
|
||||
};
|
||||
|
|
|
@ -36,7 +36,7 @@ export default function NumberTicker({
|
|||
springValue.on("change", (latest) => {
|
||||
if (ref.current) {
|
||||
ref.current.textContent = Intl.NumberFormat("en-US").format(
|
||||
latest.toFixed(0)
|
||||
parseInt(latest.toFixed(0))
|
||||
);
|
||||
}
|
||||
}),
|
||||
|
|
Loading…
Reference in a new issue