Added PlantTouchPoint and IPMSchedule models. Implemented touch-points and IPM controllers/routes. Updated frontend with Dashboard feed and IPM widgets.
25 lines
771 B
TypeScript
25 lines
771 B
TypeScript
import api from './api';
|
|
|
|
export type PhotoRequirement = 'REQUIRED' | 'OPTIONAL' | 'WEEKLY' | 'ON_DEMAND';
|
|
|
|
export interface WalkthroughSettings {
|
|
id: string;
|
|
reservoirPhotos: PhotoRequirement;
|
|
irrigationPhotos: PhotoRequirement;
|
|
plantHealthPhotos: PhotoRequirement;
|
|
enableReservoirs: boolean;
|
|
enableIrrigation: boolean;
|
|
enablePlantHealth: boolean;
|
|
}
|
|
|
|
export const settingsApi = {
|
|
getWalkthrough: async () => {
|
|
const response = await api.get<WalkthroughSettings>('/walkthrough-settings');
|
|
return response.data;
|
|
},
|
|
|
|
updateWalkthrough: async (data: Partial<WalkthroughSettings>) => {
|
|
const response = await api.patch<WalkthroughSettings>('/walkthrough-settings', data);
|
|
return response.data;
|
|
}
|
|
};
|