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

Function resetUser

backend/src/dal/user.ts:117–161  ·  view source on GitHub ↗
(uid: string)

Source from the content-addressed store, hash-verified

115}
116
117export async function resetUser(uid: string): Promise<void> {
118 await getUsersCollection().updateOne(
119 { uid },
120 {
121 $set: {
122 personalBests: {
123 time: {},
124 words: {},
125 quote: {},
126 zen: {},
127 custom: {},
128 },
129 lbPersonalBests: {
130 time: {},
131 },
132 completedTests: 0,
133 startedTests: 0,
134 timeTyping: 0,
135 lbMemory: {},
136 bananas: 0,
137 profileDetails: {
138 bio: "",
139 keyboard: "",
140 socialProfiles: {},
141 },
142 favoriteQuotes: {},
143 customThemes: [],
144 tags: [],
145 xp: 0,
146 streak: {
147 length: 0,
148 lastResultTimestamp: 0,
149 maxLength: 0,
150 },
151 testActivity: {},
152 },
153 $unset: {
154 discordAvatar: "",
155 discordId: "",
156 lbOptOut: "",
157 inbox: "",
158 },
159 },
160 );
161}
162
163export async function updateName(
164 uid: string,

Callers

nothing calls this directly

Calls 1

getUsersCollectionFunction · 0.85

Tested by

no test coverage detected