From d8e16db5357e5fbac9f701171894a4e641db3df8 Mon Sep 17 00:00:00 2001 From: Martin Porwoll Date: Fri, 20 Feb 2026 15:19:09 +0000 Subject: [PATCH] fix: export SeoSetting type and fix getSeoSettings return type getSeoSettings() was returning Record which prevented TypeScript from seeing metaDefaults properties. Now properly returns SeoSetting type with full type safety. Co-Authored-By: Claude Opus 4.6 --- src/api-client/settings.ts | 6 +++--- src/types/collections.ts | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/api-client/settings.ts b/src/api-client/settings.ts index 54725b4..85df3af 100644 --- a/src/api-client/settings.ts +++ b/src/api-client/settings.ts @@ -1,7 +1,7 @@ /** * 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 { PayloadClient } from './client' @@ -21,8 +21,8 @@ export function createSettingsApi(client: PayloadClient) { /** * Get SEO global settings */ - async getSeoSettings(options?: GlobalQueryParams): Promise> { - return client.getGlobal('seo-settings', options) + async getSeoSettings(options?: GlobalQueryParams): Promise { + return client.getGlobal('seo-settings', options) as Promise }, /** diff --git a/src/types/collections.ts b/src/types/collections.ts index 85dfd98..208d511 100644 --- a/src/types/collections.ts +++ b/src/types/collections.ts @@ -44,6 +44,7 @@ import type { MonitoringAlertRule, MonitoringAlertHistory, SiteSetting, + SeoSetting, Navigation, Form, } from './payload-types' @@ -91,6 +92,7 @@ export type { MonitoringAlertRule, MonitoringAlertHistory, SiteSetting, + SeoSetting, Navigation, Form, } from './payload-types'