import { WorkoutPlan } from '../types'; import { api } from './api'; export const getPlans = async (userId: string): Promise => { try { return await api.get('/plans'); } catch { return []; } }; export const savePlan = async (userId: string, plan: WorkoutPlan): Promise => { await api.post('/plans', plan); }; export const deletePlan = async (userId: string, id: string): Promise => { await api.delete(`/plans/${id}`); };