mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-03-12 08:47:28 +08:00
feat: init 2.0.0 config file edit
This commit is contained in:
17
src/lib/config.client.ts
Normal file
17
src/lib/config.client.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
'use client';
|
||||
|
||||
export async function getCustomCategories(): Promise<{
|
||||
name: string;
|
||||
type: 'movie' | 'tv';
|
||||
query: string;
|
||||
}[]> {
|
||||
const res = await fetch('/api/config/custom_category');
|
||||
const data = await res.json();
|
||||
return data.filter((item: any) => !item.disabled).map((category: any) => ({
|
||||
name: category.name || '',
|
||||
type: category.type,
|
||||
query: category.query,
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user