mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
refator: use TimeOptions for TopArtists report
This commit is contained in:
parent
ad0d197105
commit
5bc76f23d0
9 changed files with 62 additions and 46 deletions
|
|
@ -111,7 +111,9 @@ export const getListensReport = async (
|
|||
export const getTopArtists = async (
|
||||
options: TopArtistsOptions
|
||||
): Promise<TopArtistsItem[]> => {
|
||||
const { timePreset, customTimeStart, customTimeEnd } = options;
|
||||
const {
|
||||
time: { timePreset, customTimeStart, customTimeEnd },
|
||||
} = options;
|
||||
|
||||
const res = await fetch(
|
||||
`/api/v1/reports/top-artists?${qs({
|
||||
|
|
|
|||
7
frontend/src/api/entities/time-options.ts
Normal file
7
frontend/src/api/entities/time-options.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { TimePreset } from "./time-preset.enum";
|
||||
|
||||
export interface TimeOptions {
|
||||
timePreset: TimePreset;
|
||||
customTimeStart: Date;
|
||||
customTimeEnd: Date;
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
import { TimePreset } from "./time-preset.enum";
|
||||
import { TimeOptions } from "./time-options";
|
||||
|
||||
export interface TopArtistsOptions {
|
||||
timePreset: TimePreset;
|
||||
customTimeStart: Date;
|
||||
customTimeEnd: Date;
|
||||
time: TimeOptions;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue