MCPcopy Create free account
hub / github.com/xerrors/Yuxi / createUser

Function createUser

web/src/stores/user.js:186–207  ·  view source on GitHub ↗
(userData)

Source from the content-addressed store, hash-verified

184 }
185
186 async function createUser(userData) {
187 try {
188 const response = await fetch('/api/auth/users', {
189 method: 'POST',
190 headers: {
191 'Content-Type': 'application/json',
192 ...getAuthHeaders()
193 },
194 body: JSON.stringify(userData)
195 })
196
197 if (!response.ok) {
198 const error = await response.json()
199 throw new Error(error.detail || '创建用户失败')
200 }
201
202 return await response.json()
203 } catch (error) {
204 console.error('创建用户错误:', error)
205 throw error
206 }
207 }
208
209 async function updateUser(userId, userData) {
210 try {

Callers

nothing calls this directly

Calls 2

getAuthHeadersFunction · 0.85
jsonMethod · 0.80

Tested by

no test coverage detected