feat(FE playlist): get playlist
This commit is contained in:
parent
5daec331f8
commit
03bae2faa7
1 changed files with 23 additions and 0 deletions
|
@ -1,4 +1,6 @@
|
|||
import {VTextarea, VTextField} from "vuetify/components";
|
||||
import axios, {type AxiosResponse} from "axios";
|
||||
import type {Show} from "@models/show/show.ts";
|
||||
|
||||
export function playlist(item) {
|
||||
const visibleFields = {
|
||||
|
@ -34,4 +36,25 @@ export function playlist(item) {
|
|||
// console.log(fields)
|
||||
return fields
|
||||
}
|
||||
}
|
||||
|
||||
// TODO playlist interface
|
||||
export const getPlaylist = async (options: {
|
||||
id?: number | null;
|
||||
scheduled?: number | null;
|
||||
withDjs?: boolean | null;
|
||||
isScheduled?: boolean | null;
|
||||
page?: Number | null;
|
||||
per_page?: Number | null;
|
||||
all?: string | null;
|
||||
}): Promise<Show[]> => {
|
||||
const filteredParams = Object.fromEntries(
|
||||
Object.entries(options).filter(([_, value]) => value !== undefined && value !== null)
|
||||
);
|
||||
return await axios.get(`/playlist`, {params: filteredParams})
|
||||
.then((response: AxiosResponse) => {
|
||||
return response.data.data
|
||||
}).catch((error: Error) => {
|
||||
console.log("Error: " + error);
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue