import { apiGet, apiPost } from '@/lib/http'
import type { AdminKuaishouCloudFulfillmentConfig } from '@/types/admin'

export function fetchAdminKuaishouCloudFulfillmentConfig() {
  return apiGet<{
    filePath: string
    source: AdminKuaishouCloudFulfillmentConfig
  }>('/api/v1/admin/platform-config/kuaishou-cloud-fulfillment')
}

export function saveAdminKuaishouCloudFulfillmentConfig(
  payload: AdminKuaishouCloudFulfillmentConfig,
) {
  return apiPost<{
    filePath: string
    source: AdminKuaishouCloudFulfillmentConfig
  }>('/api/v1/admin/platform-config/kuaishou-cloud-fulfillment', payload)
}
