-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: disallow duplicate fieldNames to be used on the same level in th…
…e config (#4381)
- Loading branch information
1 parent
548e78c
commit a1d66b8
Showing
14 changed files
with
755 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import APIError from './APIError' | ||
|
||
class DuplicateFieldName extends APIError { | ||
constructor(fieldName: string) { | ||
super( | ||
`A field with the name '${fieldName}' was found multiple times on the same level. Field names must be unique.`, | ||
) | ||
} | ||
} | ||
|
||
export default DuplicateFieldName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,225 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* This file was automatically generated by Payload CMS. | ||
* This file was automatically generated by Payload. | ||
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config, | ||
* and re-run `payload generate:types` to regenerate this file. | ||
*/ | ||
|
||
export interface Config { | ||
collections: { | ||
posts: Post | ||
'error-fields': ErrorField | ||
uploads: Upload | ||
users: User | ||
'payload-preferences': PayloadPreference | ||
'payload-migrations': PayloadMigration | ||
} | ||
globals: {} | ||
} | ||
export interface Post { | ||
export interface ErrorField { | ||
id: string | ||
arrayField?: { | ||
group23field: { | ||
arrayField: { | ||
group23field: { | ||
arrayField: { | ||
textField: string | ||
id?: string | ||
parentArray?: | ||
| { | ||
childArray: { | ||
childArrayText: string | ||
id?: string | null | ||
}[] | ||
id?: string | null | ||
}[] | ||
| null | ||
home: { | ||
tabText: string | ||
text: string | ||
array?: | ||
| { | ||
requiredArrayText: string | ||
arrayText?: string | null | ||
group: { | ||
text: string | ||
number: number | ||
date: string | ||
checkbox: boolean | ||
} | ||
code: string | ||
json: | ||
| { | ||
[k: string]: unknown | ||
} | ||
| unknown[] | ||
| string | ||
| number | ||
| boolean | ||
| null | ||
email: string | ||
/** | ||
* @minItems 2 | ||
* @maxItems 2 | ||
*/ | ||
point: [number, number] | ||
radio: 'mint' | 'dark_gray' | ||
relationship: string | User | ||
richtext: { | ||
[k: string]: unknown | ||
}[] | ||
select: 'mint' | 'dark_gray' | ||
upload: string | Upload | ||
text: string | ||
textarea: string | ||
id?: string | null | ||
}[] | ||
| null | ||
} | ||
tabText: string | ||
text: string | ||
array?: | ||
| { | ||
requiredArrayText: string | ||
arrayText?: string | null | ||
group: { | ||
text: string | ||
number: number | ||
date: string | ||
checkbox: boolean | ||
} | ||
id?: string | ||
code: string | ||
json: | ||
| { | ||
[k: string]: unknown | ||
} | ||
| unknown[] | ||
| string | ||
| number | ||
| boolean | ||
| null | ||
email: string | ||
/** | ||
* @minItems 2 | ||
* @maxItems 2 | ||
*/ | ||
point: [number, number] | ||
radio: 'mint' | 'dark_gray' | ||
relationship: string | User | ||
richtext: { | ||
[k: string]: unknown | ||
}[] | ||
select: 'mint' | 'dark_gray' | ||
upload: string | Upload | ||
text: string | ||
textarea: string | ||
id?: string | null | ||
}[] | ||
| null | ||
layout?: | ||
| { | ||
tabText: string | ||
text: string | ||
array?: | ||
| { | ||
requiredArrayText: string | ||
arrayText?: string | null | ||
group: { | ||
text: string | ||
number: number | ||
date: string | ||
checkbox: boolean | ||
} | ||
code: string | ||
json: | ||
| { | ||
[k: string]: unknown | ||
} | ||
| unknown[] | ||
| string | ||
| number | ||
| boolean | ||
| null | ||
email: string | ||
/** | ||
* @minItems 2 | ||
* @maxItems 2 | ||
*/ | ||
point: [number, number] | ||
radio: 'mint' | 'dark_gray' | ||
relationship: string | User | ||
richtext: { | ||
[k: string]: unknown | ||
}[] | ||
select: 'mint' | 'dark_gray' | ||
upload: string | Upload | ||
text: string | ||
textarea: string | ||
id?: string | null | ||
}[] | ||
| null | ||
id?: string | null | ||
blockName?: string | null | ||
blockType: 'block1' | ||
}[] | ||
} | ||
id?: string | ||
}[] | ||
| null | ||
group: { | ||
text: string | ||
} | ||
updatedAt: string | ||
createdAt: string | ||
} | ||
export interface User { | ||
id: string | ||
updatedAt: string | ||
createdAt: string | ||
email?: string | ||
resetPasswordToken?: string | ||
resetPasswordExpiration?: string | ||
salt?: string | ||
hash?: 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 | ||
} | ||
export interface Upload { | ||
id: string | ||
text?: string | null | ||
media?: string | Upload | null | ||
richText?: | ||
| { | ||
[k: string]: unknown | ||
}[] | ||
| null | ||
updatedAt: string | ||
createdAt: string | ||
url?: string | null | ||
filename?: string | null | ||
mimeType?: string | null | ||
filesize?: number | null | ||
width?: number | null | ||
height?: number | null | ||
} | ||
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 | ||
} | ||
export interface PayloadMigration { | ||
id: string | ||
name?: string | null | ||
batch?: number | null | ||
updatedAt: string | ||
createdAt: string | ||
} | ||
|
||
declare module 'payload' { | ||
export interface GeneratedTypes extends Config {} | ||
} |
Oops, something went wrong.