update interfaces to use the updated property names

+ misc changes related to moving to sqlite
This commit is contained in:
geoffrey45
2022-11-21 20:03:56 +03:00
committed by Mungai Njoroge
parent 881adc0f88
commit f3c4f0310a
30 changed files with 166 additions and 137 deletions
+6 -8
View File
@@ -1,8 +1,6 @@
import { paths } from "@/config";
import { Artist } from "../../interfaces";
import { Playlist, Track } from "../../interfaces";
import { Artist, Playlist, Track } from "../../interfaces";
import { Notification, NotifType } from "../../stores/notification";
import state from "../state";
import useAxios from "./useAxios";
const {
@@ -67,12 +65,12 @@ async function getAllPlaylists(): Promise<Playlist[]> {
}
async function addTrackToPlaylist(playlist: Playlist, track: Track) {
const uri = `${basePlaylistUrl}/${playlist.playlistid}/add`;
const uri = `${basePlaylistUrl}/${playlist.id}/add`;
const { status } = await useAxios({
url: uri,
props: {
track: track.trackid,
track: track.trackhash,
},
});
@@ -92,13 +90,13 @@ async function getPlaylist(pid: string) {
tracks: Track[];
}
const { data, error } = await useAxios({
const { data, status } = await useAxios({
url: uri,
get: true,
});
if (error) {
new Notification("Something funny happened!", NotifType.Error);
if (status == 404) {
new Notification("Playlist not found", NotifType.Error);
}
if (data) {