Assist_Design/apps/portal/src/lib/services/currency.service.ts
barsa a3dbd07183 Enhance ESLint Rules and Refactor Domain Imports
- Updated ESLint configuration to enforce stricter import rules for the @customer-portal/domain package, promoting better import hygiene and preventing deep imports.
- Refactored various files across the BFF and portal applications to comply with the new import rules, ensuring that only the appropriate modules are imported from the domain.
- Cleaned up unused imports and optimized code structure for improved maintainability and clarity.
- Updated documentation to reflect changes in import practices and domain structure.
2025-12-26 14:53:03 +09:00

17 lines
606 B
TypeScript

import { apiClient, getDataOrThrow } from "@/lib/api";
import { FALLBACK_CURRENCY, type Currency } from "@customer-portal/domain/billing";
export { FALLBACK_CURRENCY };
export const currencyService = {
async getDefaultCurrency(): Promise<Currency> {
const response = await apiClient.GET<Currency>("/api/currency/default");
return getDataOrThrow(response, "Failed to get default currency");
},
async getAllCurrencies(): Promise<Currency[]> {
const response = await apiClient.GET<Currency[]>("/api/currency/all");
return getDataOrThrow(response, "Failed to get currencies");
},
};