feat(settings): add settings route and API updates\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,19 +1,4 @@
|
||||
import type { LoaderFunction } from '@remix-run/node';
|
||||
import { json } from '@remix-run/node';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { requireAdmin } from '~/lib/auth.server';
|
||||
import { settingsService } from '~/lib/settings.server';
|
||||
|
||||
export const loader: LoaderFunction = async ({ request }) => {
|
||||
await requireAdmin(request);
|
||||
await settingsService.init?.();
|
||||
const entries: any[] = [];
|
||||
// @ts-ignore
|
||||
for (const key of (settingsService as any).cache.keys()) {
|
||||
entries.push({ key, value: await settingsService.get(key) });
|
||||
}
|
||||
return json({ entries });
|
||||
};
|
||||
|
||||
export default function SettingsPage() {
|
||||
const [items, setItems] = useState<Array<{ key: string; value: any }>>([]);
|
||||
|
||||
Reference in New Issue
Block a user