mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Refactor reviewer handling in MCP review route to improve readability and maintainability
This commit is contained in:
parent
10e6cfc7a3
commit
5552bd7104
@ -32,14 +32,17 @@ export const POST = createSmartRouteHandler({
|
||||
assertIsAiChatReviewer(user);
|
||||
|
||||
const token = getEnvVariable("STACK_MCP_LOG_TOKEN");
|
||||
const reviewer = user.display_name ?? user.primary_email ?? user.id;
|
||||
|
||||
await callReducerStrict("upsert_qa_from_call", [
|
||||
token,
|
||||
body.correlationId,
|
||||
body.correctedQuestion,
|
||||
body.correctedAnswer,
|
||||
body.publish,
|
||||
user.display_name ?? user.primary_email ?? user.id,
|
||||
reviewer,
|
||||
]);
|
||||
await callReducerStrict("mark_human_reviewed", [token, body.correlationId, reviewer]);
|
||||
|
||||
return {
|
||||
statusCode: 200,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user