fix: Removed console logs.

This commit is contained in:
James Melvin
2023-01-08 10:17:28 +05:30
parent e018e4ffd1
commit 81a47eeafd
+5 -18
View File
@@ -13,22 +13,10 @@ const handler = async (req, res) => {
res.status(401).end();
return;
}
console.log(JSON.parse(req.body));
// Parse out the local task ID and the interaction contents.
const { post_id, label_map, text } = await JSON.parse(req.body);
console.log(JSON.stringify(
{
"type": "text_labels",
"message_id": post_id,
"labels": label_map,
"text": text,
"user": {
"id": token.sub,
"display_name": token.name || token.email,
"auth_method": "local",
}}));
console.log("Here sending text_labels1...");
// Send the interaction to the Text Label to the Backend.
// Parse out the local message_id, task ID and the interaction contents.
const { message_id, post_id, label_map, text } = await JSON.parse(req.body);
const interactionRes = await fetch(`${process.env.FASTAPI_URL}/api/v1/text_labels`, {
method: "POST",
headers: {
@@ -37,7 +25,7 @@ const handler = async (req, res) => {
},
body: JSON.stringify({
"type": "text_labels",
"message_id": post_id,
"message_id": message_id,
"labels": label_map,
"text": text,
"user": {
@@ -48,7 +36,6 @@ const handler = async (req, res) => {
}),
});
console.log(interactionRes);
res.status(interactionRes.status).json(interactionRes.json());
};