generated from autonomic-cooperative/astro-payload-template
Add payload seed
This commit is contained in:
parent
747ada89e9
commit
985774bf24
15
payload/src/seed.ts
Normal file
15
payload/src/seed.ts
Normal 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']
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user