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

Function getPresets

backend/src/api/controllers/preset.ts:13–26  ·  view source on GitHub ↗
(
  req: MonkeyRequest,
)

Source from the content-addressed store, hash-verified

11import { MonkeyRequest } from "../types";
12
13export async function getPresets(
14 req: MonkeyRequest,
15): Promise<GetPresetResponse> {
16 const { uid } = req.ctx.decodedToken;
17
18 const data = (await PresetDAL.getPresets(uid))
19 .map((preset) => ({
20 ...preset,
21 uid: undefined,
22 }))
23 .map((it) => replaceObjectId(it));
24
25 return new MonkeyResponse("Presets retrieved", data);
26}
27
28export async function addPreset(
29 req: MonkeyRequest<undefined, AddPresetRequest>,

Callers

nothing calls this directly

Calls 1

replaceObjectIdFunction · 0.90

Tested by

no test coverage detected