import { apiRequest } from './api.js'

export function fetchSettings() {
  return apiRequest('/settings')
}

export function saveSettings(payload) {
  return apiRequest('/settings', {
    method: 'PUT',
    body: JSON.stringify(payload)
  })
}

export function testModelConnectivity(payload) {
  return apiRequest('/settings/model-connectivity', {
    method: 'POST',
    body: JSON.stringify(payload)
  })
}

export function clearSystemCaches() {
  return apiRequest('/settings/cache/clear', {
    method: 'POST'
  })
}
