refactor(self-hosting): forward every setting, drop dead config (#3047)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-30 00:58:43 +02:00
1 parent 39f9beda5a
commit 2b8a743dc5
96 files changed
+1743 -2391

No files matched your search

@@ -1,24 +1,15 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {getConfig} from '@fluxer/config/src/ConfigLoader';
import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
import {BadRequestError} from '@fluxer/errors/src/domains/core/BadRequestError';
export class MaxBookmarksError extends BadRequestError {
constructor(params: {
maxBookmarks: number;
isPremium?: boolean;
}) {
const {maxBookmarks, isPremium} = params;
const config = getConfig();
const selfHosted = 'self_hosted' in config ? config.self_hosted : false;
constructor(params: {maxBookmarks: number}) {
const {maxBookmarks} = params;
super({
code: APIErrorCodes.MAX_BOOKMARKS,
messageVariables: {count: maxBookmarks},
data: {
max_bookmarks: maxBookmarks,
...(selfHosted || isPremium === undefined ? {} : {is_premium: isPremium}),
},
data: {max_bookmarks: maxBookmarks},
});
}
}