MCPcopy Create free account
hub / github.com/monkeytypegame/monkeytype / approveQuote

Function approveQuote

backend/src/api/controllers/quote.ts:70–86  ·  view source on GitHub ↗
(
  req: MonkeyRequest<undefined, ApproveQuoteRequest>,
)

Source from the content-addressed store, hash-verified

68}
69
70export async function approveQuote(
71 req: MonkeyRequest<undefined, ApproveQuoteRequest>,
72): Promise<ApproveQuoteResponse> {
73 const { uid } = req.ctx.decodedToken;
74 const { quoteId, editText, editSource } = req.body;
75
76 const { name } = await getPartialUser(uid, "approve quote", ["name"]);
77
78 if (!name) {
79 throw new MonkeyError(500, "Missing name field");
80 }
81
82 const data = await NewQuotesDAL.approve(quoteId, editText, editSource, name);
83 void addLog("system_quote_approved", data, uid);
84
85 return new MonkeyResponse(data.message, data.quote);
86}
87
88export async function refuseQuote(
89 req: MonkeyRequest<undefined, RejectQuoteRequest>,

Callers

nothing calls this directly

Calls 2

getPartialUserFunction · 0.90
addLogFunction · 0.90

Tested by

no test coverage detected