add dropdown logic for revenue report, defaults to USD for unknown currency code

This commit is contained in:
Francis Cao 2024-09-26 22:35:23 -07:00
parent 214396f4b6
commit be50e8a575
8 changed files with 155 additions and 12 deletions

View file

@ -0,0 +1,18 @@
import { useApi } from './useApi';
export function useRevenueValues(websiteId: string, startDate: Date, endDate: Date) {
const { get, useQuery } = useApi();
return useQuery({
queryKey: ['revenue:values', { websiteId, startDate, endDate }],
queryFn: () =>
get(`/reports/revenue`, {
websiteId,
startDate,
endDate,
}),
enabled: !!(websiteId && startDate && endDate),
});
}
export default useRevenueValues;