import api from './api';

export interface SeoSettings {
  site_title?: string;
  site_description?: string;
  meta_keywords?: string;
  default_og_image_url?: string;
  twitter_handle?: string;
  canonical_base_url?: string;
  additional_meta?: string;
  enable_indexing?: boolean;
}

export async function getSeoSettings(): Promise<SeoSettings> {
  const res = await api.get<SeoSettings>('/admin/seo');
  return res.data || {};
}

export async function updateSeoSettings(payload: Partial<SeoSettings>): Promise<{ ok: boolean }> {
  const res = await api.put<{ ok: boolean }>('/admin/seo', payload);
  return res.data;
}
