fix: pre-commit errors

This commit is contained in:
James Melvin
2023-01-08 10:52:50 +05:30
parent 3d469baaf5
commit d4fdaeca81
2 changed files with 17 additions and 13 deletions
+11 -12
View File
@@ -13,10 +13,10 @@ const handler = async (req, res) => {
res.status(401).end();
return;
}
// 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: {
@@ -24,16 +24,15 @@ const handler = async (req, res) => {
"Content-Type": "application/json",
},
body: JSON.stringify({
"type": "text_labels",
"message_id": message_id,
"labels": label_map,
"text": text,
"user": {
"id": token.sub,
"display_name": token.name || token.email,
"auth_method": "local",
}
type: "text_labels",
message_id: message_id,
labels: label_map,
text: text,
user: {
id: token.sub,
display_name: token.name || token.email,
auth_method: "local",
},
}),
});
res.status(interactionRes.status).end();