mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
refactor: use TimeOptions for Listens report
This commit is contained in:
parent
5bc76f23d0
commit
67ea28aec7
7 changed files with 51 additions and 59 deletions
|
|
@ -79,13 +79,17 @@ export const getRecentListens = async (
|
|||
export const getListensReport = async (
|
||||
options: ListenReportOptions
|
||||
): Promise<ListenReportItem[]> => {
|
||||
const { timeFrame, timeStart, timeEnd } = options;
|
||||
const {
|
||||
timeFrame,
|
||||
time: { timePreset, customTimeStart, customTimeEnd },
|
||||
} = options;
|
||||
|
||||
const res = await fetch(
|
||||
`/api/v1/reports/listens?${qs({
|
||||
timeFrame,
|
||||
timeStart: formatISO(timeStart),
|
||||
timeEnd: formatISO(timeEnd),
|
||||
timePreset,
|
||||
customTimeStart: formatISO(customTimeStart),
|
||||
customTimeEnd: formatISO(customTimeEnd),
|
||||
})}`,
|
||||
{
|
||||
headers: getDefaultHeaders(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue