MCPcopy Index your code
hub / github.com/CapSoftware/Cap / updateUser

Function updateUser

packages/database/auth/drizzle-adapter.ts:276–293  ·  view source on GitHub ↗
({ id, image, ...userData })

Source from the content-addressed store, hash-verified

274 return row?.users ?? null;
275 },
276 async updateUser({ id, image, ...userData }) {
277 if (!id) throw new Error("User not found");
278 await db
279 .update(users)
280 .set({
281 ...userData,
282 image: image as ImageUpload.ImageUrlOrKey | null,
283 })
284 .where(eq(users.id, User.UserId.make(id)));
285 const rows = await db
286 .select()
287 .from(users)
288 .where(eq(users.id, User.UserId.make(id)))
289 .limit(1);
290 const row = rows[0];
291 if (!row) throw new Error("User not found");
292 return row;
293 },
294 async deleteUser(userId) {
295 await db.delete(users).where(eq(users.id, User.UserId.make(userId)));
296 },

Callers 1

createOrUpdateEmailUserFunction · 0.85

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected