chore: eslint the _community code

This commit is contained in:
Paul Popus
2024-03-12 10:52:41 -03:00
parent b327dd31b7
commit 6e03558dcb
3 changed files with 16 additions and 16 deletions

View File

@@ -4,30 +4,30 @@ export const mediaSlug = 'media'
export const MediaCollection: CollectionConfig = { export const MediaCollection: CollectionConfig = {
slug: mediaSlug, slug: mediaSlug,
access: {
create: () => true,
read: () => true,
},
fields: [],
upload: { upload: {
crop: true, crop: true,
focalPoint: true, focalPoint: true,
imageSizes: [ imageSizes: [
{ {
name: 'thumbnail', name: 'thumbnail',
width: 200,
height: 200, height: 200,
width: 200,
}, },
{ {
name: 'medium', name: 'medium',
width: 800,
height: 800, height: 800,
width: 800,
}, },
{ {
name: 'large', name: 'large',
width: 1200,
height: 1200, height: 1200,
width: 1200,
}, },
], ],
}, },
access: {
read: () => true,
create: () => true,
},
fields: [],
} }

View File

@@ -5,12 +5,10 @@ import { mediaSlug } from '../Media/index.js'
export const postsSlug = 'posts' export const postsSlug = 'posts'
export const PostsCollection: CollectionConfig = { export const PostsCollection: CollectionConfig = {
slug: postsSlug,
admin: { admin: {
useAsTitle: 'text', useAsTitle: 'text',
}, },
versions: {
drafts: true,
},
fields: [ fields: [
{ {
name: 'text', name: 'text',
@@ -27,12 +25,12 @@ export const PostsCollection: CollectionConfig = {
}, },
{ {
name: 'associatedMedia', name: 'associatedMedia',
type: 'upload',
access: { access: {
create: () => true, create: () => true,
update: () => false, update: () => false,
}, },
relationTo: mediaSlug, relationTo: mediaSlug,
type: 'upload',
}, },
{ {
name: 'blocksField', name: 'blocksField',
@@ -42,12 +40,12 @@ export const PostsCollection: CollectionConfig = {
slug: 'block1', slug: 'block1',
fields: [ fields: [
{ {
type: 'group',
name: 'group1', name: 'group1',
type: 'group',
fields: [ fields: [
{ {
type: 'text',
name: 'group1Text', name: 'group1Text',
type: 'text',
}, },
], ],
}, },
@@ -56,5 +54,7 @@ export const PostsCollection: CollectionConfig = {
], ],
}, },
], ],
slug: postsSlug, versions: {
drafts: true,
},
} }

View File

@@ -34,7 +34,7 @@ export default buildConfigWithDefaults({
const imageFilePath = path.resolve(process.cwd(), './test/uploads/image.png') const imageFilePath = path.resolve(process.cwd(), './test/uploads/image.png')
const imageFile = await getFileByPath(imageFilePath) const imageFile = await getFileByPath(imageFilePath)
const { id: uploadedImage } = await payload.create({ await payload.create({
collection: 'media', collection: 'media',
data: {}, data: {},
file: imageFile, file: imageFile,