Change typings & refactor FlaggableElement

This commit is contained in:
klotske
2023-01-12 16:10:05 +03:00
parent d8328807f4
commit 82a60ef904
7 changed files with 40 additions and 28 deletions
+3 -3
View File
@@ -5,8 +5,8 @@ import { withoutRole } from "src/lib/auth";
*
*/
const handler = withoutRole("banned", async (req, res, token) => {
// 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);
// Parse out the local message_id, and the interaction contents.
const { message_id, label_map, text } = await JSON.parse(req.body);
const interactionRes = await fetch(`${process.env.FASTAPI_URL}/api/v1/text_labels`, {
method: "POST",
@@ -16,7 +16,7 @@ const handler = withoutRole("banned", async (req, res, token) => {
},
body: JSON.stringify({
type: "text_labels",
message_id: message_id || post_id,
message_id: message_id,
labels: label_map,
text: text,
user: {