feat(FE): axios helper func
This commit is contained in:
parent
50a8497bf4
commit
bba0f09389
4 changed files with 33 additions and 58 deletions
|
@ -1,6 +1,7 @@
|
|||
import {VTextarea, VTextField} from "vuetify/components";
|
||||
import axios, {type AxiosResponse} from "axios";
|
||||
import type {Show} from "@models/show/show.ts";
|
||||
import {cleanOptions} from "@/helpers/AxiosHelper.ts";
|
||||
|
||||
export function playlist(item) {
|
||||
const visibleFields = {
|
||||
|
@ -48,9 +49,7 @@ export const getPlaylist = async (options: {
|
|||
per_page?: Number | null;
|
||||
all?: string | null;
|
||||
}): Promise<Show[]> => {
|
||||
const filteredParams = Object.fromEntries(
|
||||
Object.entries(options).filter(([_, value]) => value !== undefined && value !== null)
|
||||
);
|
||||
const filteredParams = cleanOptions(options);
|
||||
return await axios.get(`/playlist`, {params: filteredParams})
|
||||
.then((response: AxiosResponse) => {
|
||||
return response.data.data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue