add some stuff to home page

This commit is contained in:
Thomas Amland
2020-07-27 14:29:27 +02:00
parent d46ba950e7
commit 7ec1cac749
3 changed files with 58 additions and 4 deletions
+5 -2
View File
@@ -1,6 +1,8 @@
import axios, { AxiosRequestConfig, AxiosInstance } from "axios"
import { AuthService } from '@/auth/service';
export type AlbumSort = "alphabeticalByName" | "newest" | "recent" | "frequent" | "random"
export class API {
readonly http: AxiosInstance;
@@ -80,11 +82,12 @@ export class API {
})));
}
async getAlbums(sort: string) {
async getAlbums(sort: AlbumSort, size: number = 500) {
const params = {
type: sort,
offset: "0",
size: "500",
size: size,
};
const data = await this.get("rest/getAlbumList2", params);
return data.albumList2.album.map((item: any) => ({