import { fetchApi } from './client';
import type { LegalSettingsData } from './types';

export const legalSettingsApi = {
  get: () => fetchApi<{ settings: LegalSettingsData }>('/api/legal-settings'),

  update: (data: Partial<LegalSettingsData>) =>
    fetchApi<{ settings: LegalSettingsData; message: string }>('/api/legal-settings', {
      method: 'PUT',
      body: JSON.stringify(data),
    }),
};
