MCPcopy
hub / github.com/ModelEngine-Group/nexent / updateUser

Function updateUser

frontend/services/userService.ts:107–125  ·  view source on GitHub ↗
(
  userId: string,
  payload: UpdateUserRequest
)

Source from the content-addressed store, hash-verified

105 * Update user information
106 */
107export async function updateUser(
108 userId: string,
109 payload: UpdateUserRequest
110): Promise<User> {
111 try {
112 const response = await fetchWithAuth(API_ENDPOINTS.users.update(userId), {
113 method: "PUT",
114 body: JSON.stringify(payload),
115 });
116
117 const result: UserDetailResponse = await response.json();
118 return result.data;
119 } catch (error) {
120 if (error instanceof ApiError) {
121 throw error;
122 }
123 throw new ApiError(500, "Failed to update user");
124 }
125}
126
127/**
128 * Delete a user (soft delete)

Callers 1

handleSubmitFunction · 0.90

Calls 2

fetchWithAuthFunction · 0.90
jsonMethod · 0.45

Tested by

no test coverage detected