This commit is contained in:
2026-02-11 17:46:22 +03:00
commit eacfacb13b
266 changed files with 51337 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
// src/stores/mePasswordStore.js
import { defineStore } from 'pinia'
import api from 'src/services/api'
export const useMePasswordStore = defineStore('mePassword', {
state: () => ({
loading: false,
error: null
}),
actions: {
async changePassword (currentPassword, newPassword) {
this.loading = true
this.error = null
try {
// 🔐 Token interceptor ile otomatik
await api.post('/me/password', {
current_password: currentPassword,
new_password: newPassword
})
return true
} catch (e) {
// 🔥 api.js normalize error
this.error =
e?.message ||
'Şifre güncellenemedi'
throw e
} finally {
this.loading = false
}
}
}
})