Forwarding the real task id in backend interactions and ensure the labeling task works

This commit is contained in:
Keith Stevens
2023-01-11 19:32:52 +09:00
parent 14fa08e2e7
commit 268cd7d7b5
5 changed files with 14 additions and 18 deletions
+4 -3
View File
@@ -20,8 +20,8 @@ const handler = withoutRole("banned", async (req, res, token) => {
// Accept the task so that we can complete it, this will probably go away soon.
const registeredTask = await prisma.registeredTask.findUniqueOrThrow({ where: { id: frontendId } });
const task = registeredTask.task as Prisma.JsonObject;
const id = task.id as string;
await oasstApiClient.ackTask(id, registeredTask.id);
const taskId = task.id as string;
await oasstApiClient.ackTask(taskId, registeredTask.id);
// Log the interaction locally to create our user_post_id needed by the Task
// Backend.
@@ -38,8 +38,9 @@ const handler = withoutRole("banned", async (req, res, token) => {
let newTask;
try {
newTask = await oasstApiClient.interactTask(update_type, frontendId, interaction.id, content, token);
newTask = await oasstApiClient.interactTask(update_type, taskId, frontendId, interaction.id, content, token);
} catch (err) {
console.error(JSON.stringify(err));
return res.status(500).json(err);
}