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) {
const section = settings.home?.sections[key];
const id = section.title || key;
ss.push({
title: key,
queryKey: ["home", key],
title: id,
queryKey: ["home", id],
queryFn: async () => {
if (section.items) {
const response = await getItemsApi(api).getItems({

View File

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