chore!: admin now takes a client side custom property and custom is server only (#5926)

This commit is contained in:
Paul
2024-04-22 12:22:32 -03:00
committed by GitHub
parent 102feb9576
commit 594f319fc6
25 changed files with 93 additions and 165 deletions

View File

@@ -12,7 +12,7 @@ import { createClientFieldConfigs } from '../../fields/config/client.js'
export type ServerOnlyGlobalProperties = keyof Pick<
SanitizedGlobalConfig,
'access' | 'admin' | 'endpoints' | 'fields' | 'hooks'
'access' | 'admin' | 'custom' | 'endpoints' | 'fields' | 'hooks'
>
export type ServerOnlyGlobalAdminProperties = keyof Pick<
SanitizedGlobalConfig['admin'],
@@ -46,6 +46,7 @@ export const createClientGlobalConfig = ({
'hooks',
'access',
'endpoints',
'custom',
// `admin` is handled separately
]
@@ -55,12 +56,6 @@ export const createClientGlobalConfig = ({
}
})
if ('custom' in sanitized && sanitized.custom) {
if ('server' in sanitized.custom && sanitized.custom.server) {
delete sanitized.custom.server
}
}
if ('admin' in sanitized) {
sanitized.admin = { ...sanitized.admin }