mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-02 12:20:35 +08:00
Fetch available tasks
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { withoutRole } from "src/lib/auth";
|
||||
import { oasstApiClient } from "src/lib/oasst_api_client";
|
||||
import { getBackendUserCore } from "src/lib/users";
|
||||
|
||||
const handler = withoutRole("banned", async (req, res, token) => {
|
||||
const user = await getBackendUserCore(token.sub);
|
||||
const availableTasks = await oasstApiClient.fetch_available_tasks(user);
|
||||
res.status(200).json(availableTasks);
|
||||
});
|
||||
|
||||
export default handler;
|
||||
Reference in New Issue
Block a user