chore: updates all instances of getPayload in next to getPayloadHMR

This commit is contained in:
Jarrod Flesch 2024-05-14 14:14:42 -04:00
parent 1c30598c57
commit 61415a43fa
4 changed files with 983 additions and 990 deletions

File diff suppressed because it is too large Load Diff

View File

@ -30,9 +30,9 @@ const Page = () => {
<div className="codeBlock">
<pre>
<code>
{`import { getPayload } from 'payload'
{`import { getPayloadHMR } from '@payloadcms/next/utilities'
import configPromise from '@payload-config'
const payload = await getPayload({ config: configPromise })
const payload = await getPayloadHMR({ config: configPromise })
const data = await payload.find({
collection: 'posts',

View File

@ -1,8 +1,8 @@
import { getPayload } from 'payload'
import { getPayloadHMR } from '@payloadcms/next/utilities'
import configPromise from '@payload-config'
export const GET = async () => {
const payload = await getPayload({
const payload = await getPayloadHMR({
config: configPromise,
})

View File

@ -1,9 +1,9 @@
import React from 'react'
import { getPayload } from 'payload'
import { getPayloadHMR } from '@payloadcms/next/utilities'
import configPromise from '@payload-config'
const Example: React.FC = async () => {
const payload = await getPayload({ config: configPromise })
const payload = await getPayloadHMR({ config: configPromise })
const url = payload.getAdminURL()
return <div>The admin panel is running at: {url}</div>
}