Files
payload/test/select/collections/Users/index.ts
Paul 2d91cb613c feat: allow joins, select, populate, depth and draft to /me REST API operation (#13116)
While we can use `joins`, `select`, `populate`, `depth` or `draft` on
auth collections when finding or finding by ID, these arguments weren't
supported for `/me` which meant that in some situations like in our
ecommerce template we couldn't optimise these calls.

A workaround would be to make a call to `/me` and then get the user ID
to then use for a `findByID` operation.
2025-07-10 17:44:05 +00:00

22 lines
360 B
TypeScript

import type { CollectionConfig } from 'payload'
export const UsersCollection: CollectionConfig = {
slug: 'users',
admin: {
useAsTitle: 'email',
},
auth: true,
fields: [
{
name: 'name',
type: 'text',
defaultValue: 'Payload dev',
},
{
name: 'number',
type: 'number',
defaultValue: 42,
},
],
}