@cranberry-money/shared-services
Version:
Platform-agnostic API services with pure functions and dependency injection. Includes auth, portfolios, instruments, countries, sectors, and more.
19 lines • 719 B
JavaScript
let configuredApiClient = null;
export const configureTradeSheets = (apiClient) => {
configuredApiClient = apiClient;
};
const getConfiguredClient = () => {
if (!configuredApiClient) {
throw new Error('Trade sheets service not configured. Call configureTradeSheets(apiClient) before using trade sheets functions.');
}
return configuredApiClient;
};
export const getTradeSheets = async (params) => {
const { data } = await getConfiguredClient().get('/trade-sheets/', { params });
return data;
};
export const getTradeSheetByUuid = async (uuid) => {
const { data } = await getConfiguredClient().get(`/trade-sheets/${uuid}/`);
return data;
};
//# sourceMappingURL=tradeSheets.js.map