fix(db-postgres): camelCase point fields (#13519)

Fixes https://github.com/payloadcms/payload/issues/13394
This commit is contained in:
Sasha
2025-08-20 20:18:14 +03:00
committed by GitHub
parent 5e433aa9c3
commit aa90271a59
4 changed files with 28 additions and 1 deletions

View File

@@ -15,6 +15,10 @@ const PointFields: CollectionConfig = {
label: 'Location',
required: true,
},
{
name: 'camelCasePoint',
type: 'point',
},
{
name: 'localized',
type: 'point',

View File

@@ -1448,6 +1448,18 @@ describe('Fields', () => {
expect(updatedDoc.localized).toEqual(undefined)
})
it('should not error with camel case name point field', async () => {
if (payload.db.name === 'sqlite') {
return
}
const res = await payload.create({
collection: 'point-fields',
data: { point, camelCasePoint: [7, -7] },
})
expect(res.camelCasePoint).toEqual([7, -7])
})
})
describe('checkbox', () => {

View File

@@ -1294,6 +1294,11 @@ export interface PointField {
* @maxItems 2
*/
point: [number, number];
/**
* @minItems 2
* @maxItems 2
*/
camelCasePoint?: [number, number] | null;
/**
* @minItems 2
* @maxItems 2
@@ -2895,6 +2900,7 @@ export interface NumberFieldsSelect<T extends boolean = true> {
*/
export interface PointFieldsSelect<T extends boolean = true> {
point?: T;
camelCasePoint?: T;
localized?: T;
group?:
| T