Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-03-10 17:51:31 +03:00
parent d590732f38
commit aba71341b9
24 changed files with 299 additions and 160 deletions

View File

@@ -164,23 +164,10 @@ export const useUserDetailStore = defineStore('userDetail', {
this.error = null
try {
console.log('🟦 saveUser() START', id)
const payload = this.buildPayload()
console.log('📤 PUT payload', payload)
await put(`/users/${id}`, payload)
console.log('✅ PUT OK → REFETCH USER')
await this.fetchUser(id)
console.log('🔄 USER REFRESHED', {
hasPassword: this.hasPassword,
roles: this.form.roles,
departments: this.form.departments
})
} catch (e) {
console.error('❌ saveUser FAILED', e)
this.error = 'Kullanıcı güncellenemedi'
throw e
} finally {
@@ -196,26 +183,18 @@ export const useUserDetailStore = defineStore('userDetail', {
this.error = null
try {
console.log('🟢 createUser() START')
const payload = this.buildPayload()
console.log('📤 POST payload', payload)
const data = await post('/users', payload)
console.log('✅ CREATE OK response', data)
const newId = data?.id
if (!newId) {
throw new Error('CREATE response id yok')
}
console.log('🔁 FETCH NEW USER id=', newId)
await this.fetchUser(newId)
return newId
} catch (e) {
console.error('❌ createUser FAILED', e)
this.error = 'Kullanıcı oluşturulamadı'
throw e
} finally {