refacto: type mutu

This commit is contained in:
Julien Froidefond
2025-02-26 13:33:40 +01:00
parent 1a0e4d2422
commit 3b2d4cb0d5
7 changed files with 29 additions and 48 deletions

View File

@@ -5,9 +5,9 @@ import { getServerCacheService } from "./server-cache.service";
import { ERROR_CODES } from "../../constants/errorCodes";
import { AppError } from "../../utils/errors";
interface HomeData {
export interface HomeData {
ongoing: KomgaSeries[];
ongoingBooks: KomgaBook[]; // Nouveau champ
ongoingBooks: KomgaBook[];
recentlyRead: KomgaBook[];
onDeck: KomgaBook[];
latestSeries: KomgaSeries[];

View File

@@ -2,26 +2,13 @@ import { PreferencesModel } from "@/lib/models/preferences.model";
import { AuthServerService } from "./auth-server.service";
import { ERROR_CODES } from "../../constants/errorCodes";
import { AppError } from "../../utils/errors";
import { UserPreferences, defaultPreferences } from "@/types/preferences";
interface User {
id: string;
email: string;
}
export interface UserPreferences {
showThumbnails: boolean;
cacheMode: "memory" | "file";
showOnlyUnread: boolean;
debug: boolean;
}
const defaultPreferences: UserPreferences = {
showThumbnails: true,
cacheMode: "memory",
showOnlyUnread: false,
debug: false,
};
export class PreferencesService {
static getCurrentUser(): User {
const user = AuthServerService.getCurrentUser();