10 lines
461 B
TypeScript
10 lines
461 B
TypeScript
import api from './api';
|
|
import type { YieldStudy } from '../types';
|
|
|
|
const BASE_URL = '/yield-studies';
|
|
|
|
export const getStudies = () => api.get<YieldStudy[]>(BASE_URL);
|
|
export const createStudy = (data: Partial<YieldStudy>) => api.post<YieldStudy>(BASE_URL, data);
|
|
export const updateStudy = (id: string, data: Partial<YieldStudy>) => api.put<YieldStudy>(`${BASE_URL}/${id}`, data);
|
|
export const deleteStudy = (id: string) => api.delete(`${BASE_URL}/${id}`);
|