Fix a bunch of errors we had
This commit is contained in:
@@ -159,7 +159,7 @@ const SignIn = () => {
|
||||
};
|
||||
|
||||
const handleVerifyEmail = async (
|
||||
values: z.infer<typeof verifyEmailFormSchema>,
|
||||
_values: z.infer<typeof verifyEmailFormSchema>,
|
||||
) => {
|
||||
const formData = new FormData();
|
||||
formData.append('code', code);
|
||||
@@ -194,7 +194,7 @@ const SignIn = () => {
|
||||
<FormField
|
||||
control={verifyEmailForm.control}
|
||||
name='code'
|
||||
render={({ field }) => (
|
||||
render={({ field: _field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className='text-xl'>Code</FormLabel>
|
||||
<FormControl>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import type { LandingPageContent } from '@/components/landing/content';
|
||||
import { LandingPageBuilder } from '@/components/landing';
|
||||
import { defaultLandingPageContent } from '@/components/landing/content';
|
||||
import { RefreshRouteOnSave } from '@/components/payload/refresh-route-on-save';
|
||||
import { getLandingPageContent } from '@/lib/payload/get-landing-page-content';
|
||||
|
||||
@@ -14,7 +16,13 @@ const Home = async ({ searchParams }: HomeProps) => {
|
||||
const isPreview = Array.isArray(previewParam)
|
||||
? previewParam.includes('true')
|
||||
: previewParam === 'true';
|
||||
const content = await getLandingPageContent(isPreview);
|
||||
|
||||
let content: LandingPageContent;
|
||||
try {
|
||||
content = await getLandingPageContent(isPreview);
|
||||
} catch {
|
||||
content = defaultLandingPageContent;
|
||||
}
|
||||
|
||||
return (
|
||||
<main className='flex min-h-screen flex-col'>
|
||||
|
||||
@@ -10,9 +10,7 @@ type Args = {
|
||||
params: Promise<{
|
||||
segments: string[];
|
||||
}>;
|
||||
searchParams: Promise<{
|
||||
[key: string]: string | string[];
|
||||
}>;
|
||||
searchParams: Promise<Record<string, string | string[]>>;
|
||||
};
|
||||
|
||||
export const generateMetadata = ({
|
||||
|
||||
@@ -10,9 +10,7 @@ type Args = {
|
||||
params: Promise<{
|
||||
segments: string[];
|
||||
}>;
|
||||
searchParams: Promise<{
|
||||
[key: string]: string | string[];
|
||||
}>;
|
||||
searchParams: Promise<Record<string, string | string[]>>;
|
||||
};
|
||||
|
||||
export const generateMetadata = ({
|
||||
|
||||
@@ -16,7 +16,7 @@ type Args = {
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
const serverFunction: ServerFunctionClient = async function (args) {
|
||||
const serverFunction: ServerFunctionClient = async (args) => {
|
||||
'use server';
|
||||
return handleServerFunctions({
|
||||
...args,
|
||||
|
||||
@@ -7,14 +7,15 @@ import { getPayloadClient } from './get-payload';
|
||||
export const getLandingPageContent = async (
|
||||
isPreview = false,
|
||||
): Promise<LandingPageContent> => {
|
||||
noStore();
|
||||
if (isPreview) {
|
||||
noStore();
|
||||
}
|
||||
|
||||
const payload = await getPayloadClient();
|
||||
const landingPage = await (
|
||||
payload as {
|
||||
findGlobal: (args: { slug: string; draft?: boolean }) => Promise<unknown>;
|
||||
}
|
||||
).findGlobal({ slug: 'landing-page', draft: isPreview });
|
||||
const landingPage = await payload.findGlobal({
|
||||
slug: 'landing-page',
|
||||
draft: isPreview,
|
||||
});
|
||||
|
||||
return mergeLandingPageContent(landingPage as Partial<LandingPageContent>);
|
||||
return mergeLandingPageContent(landingPage);
|
||||
};
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* This file was automatically generated by Payload.
|
||||
|
||||
@@ -8,6 +8,7 @@ import { Users } from './payload/collections/users';
|
||||
import { LandingPage } from './payload/globals/landing-page';
|
||||
|
||||
export default buildConfig({
|
||||
serverURL: env.NEXT_PUBLIC_SITE_URL,
|
||||
editor: lexicalEditor(),
|
||||
collections: [Users],
|
||||
globals: [LandingPage],
|
||||
|
||||
@@ -11,7 +11,11 @@ export const LandingPage: GlobalConfig = {
|
||||
},
|
||||
admin: {
|
||||
livePreview: {
|
||||
url: '/?preview=true',
|
||||
url: ({
|
||||
payload,
|
||||
}: {
|
||||
payload: { config: { serverURL?: string | null } };
|
||||
}) => `${payload.config.serverURL ?? ''}/?preview=true`,
|
||||
breakpoints: [
|
||||
{
|
||||
label: 'Mobile',
|
||||
|
||||
Reference in New Issue
Block a user