// src/services/recurrentyService.ts
import apiClient from '@/services/axiosSetup';
import {RecurrentPayment} from "@/models/Recurrent";
import {useSpaceStore} from "@/stores/spaceStore";  // Импортируете настроенный экземпляр axios


export const getRecurrentPayments = async () => {
    const spaceStore = useSpaceStore()
    return await apiClient.get(`/spaces/${spaceStore.space?.id}/recurrents`);
};


export const saveRecurrentPayment = async (payment: RecurrentPayment) => {
    const spaceStore = useSpaceStore()
    return await apiClient.post(`/spaces/${spaceStore.space?.id}/recurrents`, payment)
}
//
// export const getCategoryTypes = async () => {
//     return await apiClient.get('/categories/types/');
// }
//
// export const createCategory = async (category: Category) => {
//     return await apiClient.post('/categories', category);
// };
//
// export const updateCategory = async (id: number, category: any) => {
//     return await apiClient.put(`/categories/${id}`, category);
// };
//
// export const deleteCategory = async (id: number) => {
//     return await apiClient.delete(`/categories/${id}`);
// };
