Skip to content

Instantly share code, notes, and snippets.

@kobeaerts
Created April 23, 2023 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kobeaerts/cd40e51224f9821b3ea06c3858f39a65 to your computer and use it in GitHub Desktop.
Save kobeaerts/cd40e51224f9821b3ea06c3858f39a65 to your computer and use it in GitHub Desktop.
import {
buildConfig,
} from 'payload/config';
import path from 'path';
import {
// Components,
// Manufacturers,
// Projects,
Users,
} from './collections';
export default buildConfig({
serverURL: 'http://localhost:3000',
admin: {
user: Users.slug,
},
collections: [
// Components,
// Manufacturers,
// Projects,
Users,
],
typescript: {
outputFile: path.resolve(__dirname, 'payload-types.ts'),
},
graphQL: {
schemaOutputFile: path.resolve(__dirname, 'generated-schema.graphql'),
},
});
import { CollectionConfig } from 'payload/types';
const Users: CollectionConfig = {
slug: 'users',
auth: true,
admin: {
useAsTitle: 'email',
},
access: {
read: () => true,
},
fields: [
// Email added by default
// Add more fields as needed
{
name: 'firstName',
type: 'text',
},
{
name: 'lastName',
type: 'text',
},
],
};
export default Users;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment