refactor: home section lists

This commit is contained in:
sarendsen
2025-01-22 07:27:08 +01:00
parent 93ae03f55c
commit 9aa4ea4a2e
2 changed files with 5 additions and 3 deletions

View File

@@ -306,9 +306,10 @@ export default function index() {
for (const key in settings.home?.sections) { for (const key in settings.home?.sections) {
const section = settings.home?.sections[key]; const section = settings.home?.sections[key];
const id = section.title || key;
ss.push({ ss.push({
title: key, title: id,
queryKey: ["home", key], queryKey: ["home", id],
queryFn: async () => { queryFn: async () => {
if (section.items) { if (section.items) {
const response = await getItemsApi(api).getItems({ const response = await getItemsApi(api).getItems({

View File

@@ -74,7 +74,7 @@ export enum DownloadMethod {
} }
export type Home = { export type Home = {
sections: [Object]; sections: Array<HomeSection>;
}; };
export type HomeSection = { export type HomeSection = {
@@ -84,6 +84,7 @@ export type HomeSection = {
}; };
export type HomeSectionItemResolver = { export type HomeSectionItemResolver = {
title?: string;
sortBy?: Array<ItemSortBy>; sortBy?: Array<ItemSortBy>;
sortOrder?: Array<SortOrder>; sortOrder?: Array<SortOrder>;
includeItemTypes?: Array<BaseItemKind>; includeItemTypes?: Array<BaseItemKind>;