mowing modal

This commit is contained in:
Jake Kasper
2025-09-02 09:40:42 -05:00
parent ae3275299e
commit d566be09b0
7 changed files with 456 additions and 237 deletions

View File

@@ -235,6 +235,18 @@ export const adminAPI = {
updateSettings: (settings) => apiClient.put('/admin/settings', settings),
};
// Mowing API endpoints
export const mowingAPI = {
// Plans
getPlans: () => apiClient.get('/mowing/plans'),
getPlan: (id) => apiClient.get(`/mowing/plans/${id}`),
createPlan: (data) => apiClient.post('/mowing/plans', data),
updatePlanStatus: (id, status) => apiClient.put(`/mowing/plans/${id}/status`, { status }),
// Logs/Sessions
createLog: (data) => apiClient.post('/mowing/sessions', data),
getLogs: () => apiClient.get('/mowing/logs'),
};
// Utility functions
export const handleApiError = (error, defaultMessage = 'An error occurred') => {
if (error.response?.data?.message) {