fix: export SeoSetting type and fix getSeoSettings return type

getSeoSettings() was returning Record<string, unknown> which prevented
TypeScript from seeing metaDefaults properties. Now properly returns
SeoSetting type with full type safety.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Martin Porwoll 2026-02-20 15:19:09 +00:00
parent a0eea9649d
commit d8e16db535
2 changed files with 5 additions and 3 deletions

View file

@ -1,7 +1,7 @@
/** /**
* Settings & Globals API functions * Settings & Globals API functions
*/ */
import type { SiteSetting, CookieConfiguration } from '../types/collections' import type { SiteSetting, SeoSetting, CookieConfiguration } from '../types/collections'
import type { PaginatedResponse, CollectionQueryParams, GlobalQueryParams } from '../types/api' import type { PaginatedResponse, CollectionQueryParams, GlobalQueryParams } from '../types/api'
import type { PayloadClient } from './client' import type { PayloadClient } from './client'
@ -21,8 +21,8 @@ export function createSettingsApi(client: PayloadClient) {
/** /**
* Get SEO global settings * Get SEO global settings
*/ */
async getSeoSettings(options?: GlobalQueryParams): Promise<Record<string, unknown>> { async getSeoSettings(options?: GlobalQueryParams): Promise<SeoSetting> {
return client.getGlobal('seo-settings', options) return client.getGlobal('seo-settings', options) as Promise<SeoSetting>
}, },
/** /**

View file

@ -44,6 +44,7 @@ import type {
MonitoringAlertRule, MonitoringAlertRule,
MonitoringAlertHistory, MonitoringAlertHistory,
SiteSetting, SiteSetting,
SeoSetting,
Navigation, Navigation,
Form, Form,
} from './payload-types' } from './payload-types'
@ -91,6 +92,7 @@ export type {
MonitoringAlertRule, MonitoringAlertRule,
MonitoringAlertHistory, MonitoringAlertHistory,
SiteSetting, SiteSetting,
SeoSetting,
Navigation, Navigation,
Form, Form,
} from './payload-types' } from './payload-types'