Refactor API calls to use apiRequest instead of clientFetch
Replaces all usages of clientFetch with the new apiRequest utility across dashboard pages, modal components, and the profit analytics service. This standardizes API interaction and improves consistency in request handling.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { clientFetch } from '../api';
|
||||
import { apiRequest } from '../api';
|
||||
|
||||
export interface ProfitOverview {
|
||||
period: string;
|
||||
@@ -63,7 +63,7 @@ export const getProfitOverview = async (
|
||||
url += `?period=${period}`;
|
||||
}
|
||||
|
||||
return clientFetch(url);
|
||||
return apiRequest(url);
|
||||
};
|
||||
|
||||
export const getProfitTrends = async (
|
||||
@@ -82,5 +82,5 @@ export const getProfitTrends = async (
|
||||
url += `?period=${period}`;
|
||||
}
|
||||
|
||||
return clientFetch(url);
|
||||
return apiRequest(url);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user