ca-grow-ops-manager/frontend/src/lib/settingsApi.ts
fullsizemalt e240ec7911 feat(phase2): Implement Phase 2 - Plant Touch Points & IPM
Added PlantTouchPoint and IPMSchedule models. Implemented touch-points and IPM controllers/routes. Updated frontend with Dashboard feed and IPM widgets.
2025-12-09 21:22:47 -08:00

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;
}
};