mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-08 11:13:58 +08:00
System config parameter view
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { withRole } from "src/lib/auth";
|
||||
import { createApiClient } from "src/lib/oasst_client_factory";
|
||||
|
||||
export default withRole("admin", async (_, res, token) => {
|
||||
const client = await createApiClient(token);
|
||||
|
||||
try {
|
||||
const fullSettings = await client.fetch_full_settings();
|
||||
|
||||
return res.json(fullSettings);
|
||||
} catch {
|
||||
const publicSettings = await client.fetch_public_settings();
|
||||
|
||||
return res.json(publicSettings);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user