import { createCrop, listCrops } from "@/services/dictionaryService";
import type { CropFormValues, CropItem } from "./types";

export async function fetchCropList(): Promise<CropItem[]> {
  return listCrops();
}

export async function saveCrop(values: CropFormValues): Promise<CropItem> {
  return createCrop({
    crop_name: values.cropName.trim(),
  });
}
