mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-15 12:05:19 +08:00
fix: retrieval of valid_labels from API to populate the TEXT_LABEL_FLAGS in FlaggableElements.tsx
This commit is contained in:
@@ -23,6 +23,7 @@ const handler = async (req, res) => {
|
||||
|
||||
// Fetch the new task.
|
||||
const task = await oasstApiClient.fetchTask(task_type, token);
|
||||
const valid_labels = await oasstApiClient.fetch_valid_text();
|
||||
|
||||
// Store the task and link it to the user..
|
||||
const registeredTask = await prisma.registeredTask.create({
|
||||
@@ -36,6 +37,11 @@ const handler = async (req, res) => {
|
||||
},
|
||||
});
|
||||
|
||||
// Add the valid labels that can be used to flag messages in this Task
|
||||
registeredTask["valid_labels"] = valid_labels;
|
||||
// Update the backend with our Task ID
|
||||
await oasstApiClient.ackTask(task.id, registeredTask.id);
|
||||
|
||||
// Send the results to the client.
|
||||
res.status(200).json(registeredTask);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user