website: request message specific labels for on demand labelling

This commit is contained in:
Adrian Cowan
2023-01-29 12:41:15 +11:00
parent ab4dce3f60
commit 8d45a989d6
3 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -5,8 +5,9 @@ import { createApiClient } from "src/lib/oasst_client_factory";
* Returns the set of valid labels that can be applied to messages.
*/
const handler = withoutRole("banned", async (req, res, token) => {
const { message_id } = req.query;
const client = await createApiClient(token);
const valid_labels = await client.fetch_valid_text();
const valid_labels = await client.fetch_valid_text(message_id as string);
res.status(200).json(valid_labels);
});