Fetch available tasks

This commit is contained in:
AbdBarho
2023-01-20 12:16:17 +01:00
parent c81967fca9
commit e80a69dd8a
8 changed files with 62 additions and 17 deletions
+11
View File
@@ -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;