mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-30 16:40:05 +08:00
17 lines
442 B
TypeScript
17 lines
442 B
TypeScript
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);
|
|
}
|
|
});
|