Add payload seed

This commit is contained in:
tobias 2024-05-20 13:31:57 +02:00
parent 747ada89e9
commit 985774bf24

15
payload/src/seed.ts Normal file
View File

@ -0,0 +1,15 @@
import { Payload } from "payload";
import { User } from "./payload-types";
export const seed = async (payload: Payload): Promise<void> => {
// Local API methods skip all access control by default
// so we can easily create an admin user directly in init
await payload.create<User>({
collection: 'users',
data: {
email: 'astro@ssg.js',
password: 'password',
roles: ['ssg']
}
})
}