generated from autonomic-cooperative/astro-payload-template
Add types dir to payload tsconfig
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
7dbc81c5b2
commit
cc0a5cb1c5
@ -1,5 +1,5 @@
|
||||
import { Access, FieldAccess } from "payload/types";
|
||||
import { User } from "../payload-types";
|
||||
import { User } from "@/types/payload-types";
|
||||
|
||||
export const isAdmin: Access<any, User> = ({ req: { user } }) => {
|
||||
// Return true or false based on if the user has an admin role
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Access, FieldAccess } from "payload/types";
|
||||
import { User } from "../payload-types";
|
||||
import { User } from "@/types/payload-types";
|
||||
|
||||
export const isEditor: Access<any, User> = ({ req: { user } }) => {
|
||||
// Return true or false based on if the user has an editor role
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Access, FieldAccess } from "payload/types";
|
||||
import { User } from "../payload-types";
|
||||
import { User } from "@/types/payload-types";
|
||||
|
||||
export const isSSG: Access<any, User> = ({ req: { user } }) => {
|
||||
// Return true or false based on if the user has an ssg or admin role
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Access, FieldAccess } from "payload/types";
|
||||
import { User } from "../payload-types";
|
||||
import { User } from "@/types/payload-types";
|
||||
|
||||
export const isUser: Access<any, User> = ({ req: { user } }) => {
|
||||
// Return true or false based on if the user has an ssg or admin role
|
||||
|
@ -1,15 +1,17 @@
|
||||
import { Payload } from "payload";
|
||||
import { User } from "./payload-types";
|
||||
import { User } from "@/types/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>({
|
||||
|
||||
/* Disable to prevent mistakes */
|
||||
/* await payload.create<User>({
|
||||
collection: 'users',
|
||||
data: {
|
||||
email: 'astro@ssg.js',
|
||||
password: 'password',
|
||||
roles: ['ssg']
|
||||
}
|
||||
})
|
||||
}) */
|
||||
}
|
@ -7,7 +7,8 @@
|
||||
"skipLibCheck": true,
|
||||
"outDir": "./dist",
|
||||
"paths": {
|
||||
"@/*": ["./src/*", "./dist/*", "./dist/src/*"]
|
||||
"@/*": ["./src/*", "./dist/*", "./dist/src/*"],
|
||||
"@/types/*": ["../*"]
|
||||
},
|
||||
"jsx": "react"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user