fix(drizzle): array/relationship/select hasMany in localized field (#8355)

This PR addresses these issues with localized groups / tabs with
Postgres / SQLite:

- Array fields inside of localized groups. Fixes
https://github.com/payloadcms/payload/issues/8322
- Select fields with `hasMany: true` inside of localized groups. Related
to 1, but still needed its own additional logic.
- Relationship (non-polymorphic / non has-many) inside of localized
groups. Previously, even just trying to define them in the config led to
a crash. Fixes https://github.com/payloadcms/payload/issues/8308

Ensures test coverage for localized groups.
This commit is contained in:
Sasha
2024-09-23 18:34:02 +03:00
committed by GitHub
parent 36ba6d47b4
commit 338c93a229
6 changed files with 192 additions and 3 deletions

View File

@@ -957,6 +957,20 @@ export interface GroupField {
}[]
| null;
};
localizedGroupArr?: {
array?:
| {
text?: string | null;
id?: string | null;
}[]
| null;
};
localizedGroupSelect?: {
select?: ('one' | 'two')[] | null;
};
localizedGroupRel?: {
email?: (string | null) | EmailField;
};
updatedAt: string;
createdAt: string;
}