Skip to content

Commit eadce5e

Browse files
authored
fix: extends type all to the locale type definition in req (#10399)
### What? If you query with all locales using the `'all'` value for locales, the `req.locale` value is `'all'` but the type definition only contains the available locales. ### Why? The `CustomPayloadRequestProperties.locale` property was only being typed as `TypedLocale` and was not extending `'all'.` ### How? Extends type all to the locale type definition in req Fixes #10244
1 parent f629709 commit eadce5e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/payload/src/types/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ export type CustomPayloadRequestProperties = {
2929
/**
3030
* The requested locale if specified
3131
* Only available for localized collections
32+
*
33+
* Suppressing warning below as it is a valid use case - won't be an issue if generated types exist
3234
*/
33-
locale?: TypedLocale
35+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
36+
locale?: 'all' | TypedLocale
3437
/**
3538
* The payload object
3639
*/

0 commit comments

Comments
 (0)