add dropdown logic for revenue report, defaults to USD for unknown currency code
This commit is contained in:
1 parent
214396f4b6
commit
be50e8a575
8 files changed
+155
-12
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user