fix: allow custom admin user collection in query presets constraints (#12202)
Query preset "Specific User" constraints is currently fixed to `users` collection. However, this will fail if one has a custom admin user collection.
This commit is contained in:
@@ -74,7 +74,7 @@ export const getConstraints = (config: Config): Field => ({
|
||||
},
|
||||
],
|
||||
},
|
||||
relationTo: 'users',
|
||||
relationTo: config.admin?.user ?? 'users', // TODO: remove this fallback when the args are properly typed as `SanitizedConfig`
|
||||
},
|
||||
...(config?.queryPresets?.constraints?.[operation]?.reduce(
|
||||
(acc: Field[], option: QueryPresetConstraint) => {
|
||||
|
||||
Reference in New Issue
Block a user