fix typescript

This commit is contained in:
Francesco Sansalvadore committed 2025-04-30 19:53:24 +02:00
1 parent 0109bd8963
commit 57d7c6b6b8
4 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
import { CollectionConfig } from 'payload/types'
import { CollectionConfig } from 'payload'
const Author: CollectionConfig = {
slug: 'authors',
+3 -3
View File
@@ -1,4 +1,4 @@
import { CollectionConfig } from 'payload/types'
import { CollectionConfig } from 'payload'
const BlogPost: CollectionConfig = {
slug: 'blog-posts',
@@ -22,9 +22,9 @@ const BlogPost: CollectionConfig = {
admin: {
position: 'sidebar',
},
validate: (value) => {
validate: (value: string | string[] | null | undefined) => {
const regex = /^[a-z][a-z0-9-]{2,49}$/
if (!regex.test(value)) {
if (!regex.test(value as string)) {
return 'Slug must start with a letter, contain only lowercase letters, numbers, and hyphens, and be between 3-50 characters'
}
return true
+1 -1
View File
@@ -1,4 +1,4 @@
import { CollectionConfig } from 'payload/types'
import { CollectionConfig } from 'payload'
const Category: CollectionConfig = {
slug: 'categories',
+1 -1
View File
@@ -1,4 +1,4 @@
import { CollectionConfig } from 'payload/types'
import { CollectionConfig } from 'payload'
const Tag: CollectionConfig = {
slug: 'tags',