Skip to content

Commit

Permalink
minimum reproducible of payloadcms#6485
Browse files Browse the repository at this point in the history
  • Loading branch information
ikenox committed Jun 12, 2024
1 parent ab97590 commit fcf1429
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 22 deletions.
12 changes: 5 additions & 7 deletions test/_community/collections/Posts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ export const PostsCollection: CollectionConfig = {
type: 'text',
},
{
name: 'associatedMedia',
access: {
create: () => true,
update: () => false,
},
relationTo: mediaSlug,
type: 'upload',
name: 'tags',
type: 'select',
required: true,
hasMany: true,
options: ['a', 'b', 'c'],
},
],
slug: postsSlug,
Expand Down
1 change: 1 addition & 0 deletions test/_community/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default buildConfigWithDefaults({
collection: postsSlug,
data: {
text: 'example post',
tags: ['a', 'b'],
},
})
},
Expand Down
93 changes: 78 additions & 15 deletions test/_community/payload-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/**
* This file was automatically generated by Payload.
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
Expand All @@ -10,41 +11,103 @@ export interface Config {
posts: Post
media: Media
users: User
'payload-preferences': PayloadPreference
'payload-migrations': PayloadMigration
}
globals: {
menu: Menu
}
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "posts".
*/
export interface Post {
id: string
text?: string
associatedMedia?: string | Media
text?: string | null
tags: ('a' | 'b' | 'c')[]
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "media".
*/
export interface Media {
id: string
updatedAt: string
createdAt: string
url?: string
filename?: string
mimeType?: string
filesize?: number
width?: number
height?: number
url?: string | null
filename?: string | null
mimeType?: string | null
filesize?: number | null
width?: number | null
height?: number | null
focalX?: number | null
focalY?: number | null
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "users".
*/
export interface User {
id: string
updatedAt: string
createdAt: string
email?: string
resetPasswordToken?: string
resetPasswordExpiration?: string
loginAttempts?: number
lockUntil?: string
password?: string
email: string
resetPasswordToken?: string | null
resetPasswordExpiration?: string | null
salt?: string | null
hash?: string | null
loginAttempts?: number | null
lockUntil?: string | null
password: string | null
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-preferences".
*/
export interface PayloadPreference {
id: string
user: {
relationTo: 'users'
value: string | User
}
key?: string | null
value?:
| {
[k: string]: unknown
}
| unknown[]
| string
| number
| boolean
| null
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-migrations".
*/
export interface PayloadMigration {
id: string
name?: string | null
batch?: number | null
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "menu".
*/
export interface Menu {
id: string
globalText?: string
globalText?: string | null
updatedAt?: string | null
createdAt?: string | null
}

declare module 'payload' {
export interface GeneratedTypes extends Config {}
}

0 comments on commit fcf1429

Please sign in to comment.