Merge remote-tracking branch 'origin/master'

This commit is contained in:
2026-02-16 17:20:58 +03:00
parent 0a14f87a3e
commit 484512ff25
4 changed files with 170 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
// src/stores/userDetailStore.js
import { defineStore } from 'pinia'
import api, { get, post, put } from 'src/services/api'
import api, { get, post, put, del } from 'src/services/api'
export const useUserDetailStore = defineStore('userDetail', {
state: () => ({
@@ -11,6 +11,7 @@ export const useUserDetailStore = defineStore('userDetail', {
/* ================= FLAGS ================= */
loading: false,
saving: false,
deleting: false,
error: null,
/* ================= FORM ================= */
@@ -222,6 +223,23 @@ export const useUserDetailStore = defineStore('userDetail', {
}
},
/* =====================================================
🗑️ DELETE USER
===================================================== */
async deleteUser (id) {
this.deleting = true
this.error = null
try {
await del(`/users/${id}`)
} catch (e) {
this.error = 'Kullanici silinemedi'
throw e
} finally {
this.deleting = false
}
},
/* =====================================================
📚 LOOKUPS (NEW + EDIT ORTAK)
===================================================== */