diff --git a/examples/astro/payload/src/app/my-route/route.ts b/examples/astro/payload/src/app/my-route/route.ts index a6422f3733..075588617e 100644 --- a/examples/astro/payload/src/app/my-route/route.ts +++ b/examples/astro/payload/src/app/my-route/route.ts @@ -1,14 +1,12 @@ import configPromise from '@payload-config' import { getPayload } from 'payload' -export const GET = async () => { +export const GET = async (request: Request) => { const payload = await getPayload({ config: configPromise, }) - const data = await payload.find({ - collection: 'users', + return Response.json({ + message: 'This is an example of a custom route.', }) - - return Response.json(data) } diff --git a/examples/remix/payload/src/app/my-route/route.ts b/examples/remix/payload/src/app/my-route/route.ts index a6422f3733..075588617e 100644 --- a/examples/remix/payload/src/app/my-route/route.ts +++ b/examples/remix/payload/src/app/my-route/route.ts @@ -1,14 +1,12 @@ import configPromise from '@payload-config' import { getPayload } from 'payload' -export const GET = async () => { +export const GET = async (request: Request) => { const payload = await getPayload({ config: configPromise, }) - const data = await payload.find({ - collection: 'users', + return Response.json({ + message: 'This is an example of a custom route.', }) - - return Response.json(data) } diff --git a/templates/_template/src/app/my-route/route.ts b/templates/_template/src/app/my-route/route.ts index a6422f3733..075588617e 100644 --- a/templates/_template/src/app/my-route/route.ts +++ b/templates/_template/src/app/my-route/route.ts @@ -1,14 +1,12 @@ import configPromise from '@payload-config' import { getPayload } from 'payload' -export const GET = async () => { +export const GET = async (request: Request) => { const payload = await getPayload({ config: configPromise, }) - const data = await payload.find({ - collection: 'users', + return Response.json({ + message: 'This is an example of a custom route.', }) - - return Response.json(data) } diff --git a/templates/blank/src/app/my-route/route.ts b/templates/blank/src/app/my-route/route.ts index a6422f3733..075588617e 100644 --- a/templates/blank/src/app/my-route/route.ts +++ b/templates/blank/src/app/my-route/route.ts @@ -1,14 +1,12 @@ import configPromise from '@payload-config' import { getPayload } from 'payload' -export const GET = async () => { +export const GET = async (request: Request) => { const payload = await getPayload({ config: configPromise, }) - const data = await payload.find({ - collection: 'users', + return Response.json({ + message: 'This is an example of a custom route.', }) - - return Response.json(data) } diff --git a/templates/plugin/dev/app/my-route/route.ts b/templates/plugin/dev/app/my-route/route.ts index a6422f3733..075588617e 100644 --- a/templates/plugin/dev/app/my-route/route.ts +++ b/templates/plugin/dev/app/my-route/route.ts @@ -1,14 +1,12 @@ import configPromise from '@payload-config' import { getPayload } from 'payload' -export const GET = async () => { +export const GET = async (request: Request) => { const payload = await getPayload({ config: configPromise, }) - const data = await payload.find({ - collection: 'users', + return Response.json({ + message: 'This is an example of a custom route.', }) - - return Response.json(data) } diff --git a/templates/with-payload-cloud/src/app/my-route/route.ts b/templates/with-payload-cloud/src/app/my-route/route.ts index a6422f3733..075588617e 100644 --- a/templates/with-payload-cloud/src/app/my-route/route.ts +++ b/templates/with-payload-cloud/src/app/my-route/route.ts @@ -1,14 +1,12 @@ import configPromise from '@payload-config' import { getPayload } from 'payload' -export const GET = async () => { +export const GET = async (request: Request) => { const payload = await getPayload({ config: configPromise, }) - const data = await payload.find({ - collection: 'users', + return Response.json({ + message: 'This is an example of a custom route.', }) - - return Response.json(data) } diff --git a/templates/with-postgres/src/app/my-route/route.ts b/templates/with-postgres/src/app/my-route/route.ts index a6422f3733..075588617e 100644 --- a/templates/with-postgres/src/app/my-route/route.ts +++ b/templates/with-postgres/src/app/my-route/route.ts @@ -1,14 +1,12 @@ import configPromise from '@payload-config' import { getPayload } from 'payload' -export const GET = async () => { +export const GET = async (request: Request) => { const payload = await getPayload({ config: configPromise, }) - const data = await payload.find({ - collection: 'users', + return Response.json({ + message: 'This is an example of a custom route.', }) - - return Response.json(data) } diff --git a/templates/with-vercel-mongodb/src/app/my-route/route.ts b/templates/with-vercel-mongodb/src/app/my-route/route.ts index a6422f3733..075588617e 100644 --- a/templates/with-vercel-mongodb/src/app/my-route/route.ts +++ b/templates/with-vercel-mongodb/src/app/my-route/route.ts @@ -1,14 +1,12 @@ import configPromise from '@payload-config' import { getPayload } from 'payload' -export const GET = async () => { +export const GET = async (request: Request) => { const payload = await getPayload({ config: configPromise, }) - const data = await payload.find({ - collection: 'users', + return Response.json({ + message: 'This is an example of a custom route.', }) - - return Response.json(data) } diff --git a/templates/with-vercel-postgres/src/app/my-route/route.ts b/templates/with-vercel-postgres/src/app/my-route/route.ts index a6422f3733..075588617e 100644 --- a/templates/with-vercel-postgres/src/app/my-route/route.ts +++ b/templates/with-vercel-postgres/src/app/my-route/route.ts @@ -1,14 +1,12 @@ import configPromise from '@payload-config' import { getPayload } from 'payload' -export const GET = async () => { +export const GET = async (request: Request) => { const payload = await getPayload({ config: configPromise, }) - const data = await payload.find({ - collection: 'users', + return Response.json({ + message: 'This is an example of a custom route.', }) - - return Response.json(data) }