Add types dir to payload tsconfig
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
tobias 2024-05-21 12:14:53 +02:00
parent 7dbc81c5b2
commit cc0a5cb1c5
6 changed files with 11 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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']
}
})
}) */
}

View File

@ -7,7 +7,8 @@
"skipLibCheck": true,
"outDir": "./dist",
"paths": {
"@/*": ["./src/*", "./dist/*", "./dist/src/*"]
"@/*": ["./src/*", "./dist/*", "./dist/src/*"],
"@/types/*": ["../*"]
},
"jsx": "react"
},