import axios from 'axios'; import { BaseApiService } from '@/services/api/base'; import { BaseApiResponse } from '@/types/api/api-general'; import { httpClient } from '@/services/http/client'; import { Finance } from '@/types/api/finance/finance'; // DUMMY_START import { getAllDummyFinance, getSingleDummyFinance, } from '@/dummy/finance/finance.dummy'; // DUMMY_END export class FinanceApiService extends BaseApiService< Finance, unknown, unknown > { constructor(basePath: string) { super(basePath); } async getAllFetcher(): Promise> { // DUMMY_START return await getAllDummyFinance(); // DUMMY_END // LIVE_START // try { // const path = `${this.basePath}/`; // return await httpClient>(path); // } catch (error) { // if (axios.isAxiosError>(error)) { // return error.response?.data; // } // return undefined; // } // LIVE_END } async getSingleFetcher(id: string): Promise> { // DUMMY_START console.log(id); return await getSingleDummyFinance(id); // DUMMY_END // LIVE_START // try { // const path = `${this.basePath}/`; // return await httpClient>(path); // } catch (error) { // if (axios.isAxiosError>(error)) { // return error.response?.data; // } // return undefined; // } // LIVE_END } } export const FinanceApi = new FinanceApiService('/finances');