Created
January 29, 2025 16:38
-
-
Save DanRibbens/3c3974996932ea5cec59bc4ab275f4e2 to your computer and use it in GitHub Desktop.
Paylaod error /admin/create-first-user with join field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// storage-adapter-import-placeholder | |
import { postgresAdapter } from '@payloadcms/db-postgres' | |
import { payloadCloudPlugin } from '@payloadcms/payload-cloud' | |
import { lexicalEditor } from '@payloadcms/richtext-lexical' | |
import path from 'path' | |
import { buildConfig } from 'payload' | |
import { fileURLToPath } from 'url' | |
import sharp from 'sharp' | |
import { Users } from './collections/Users' | |
const filename = fileURLToPath(import.meta.url) | |
const dirname = path.dirname(filename) | |
export default buildConfig({ | |
admin: { | |
user: Users.slug, | |
importMap: { | |
baseDir: path.resolve(dirname), | |
}, | |
}, | |
collections: [ | |
{ | |
slug: 'users', | |
auth: true, | |
fields: [ | |
{ | |
name: 'connections', | |
type: 'join', | |
collection: 'connections', | |
on: 'user', | |
}, | |
], | |
}, | |
{ | |
slug: 'connections', | |
fields: [ | |
{ | |
name: 'user', | |
type: 'relationship', | |
relationTo: 'users', | |
}, | |
], | |
}, | |
], | |
editor: lexicalEditor(), | |
secret: process.env.PAYLOAD_SECRET || '', | |
typescript: { | |
outputFile: path.resolve(dirname, 'payload-types.ts'), | |
}, | |
db: postgresAdapter({ | |
idType: 'uuid', | |
pool: { | |
connectionString: process.env.DATABASE_URI || '', | |
}, | |
}), | |
sharp, | |
plugins: [ | |
payloadCloudPlugin(), | |
// storage-adapter-placeholder | |
], | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment