mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-12-02 12:13:54 +01:00
Merge pull request #3697 from modoboa/fix/simpleuser_update_profile
Added new route dedicated to user profile update.
This commit is contained in:
@@ -6,6 +6,9 @@ export default {
|
||||
getMe() {
|
||||
return repository.get(`/${resource}/me/`)
|
||||
},
|
||||
updateMe(data) {
|
||||
return repository.put(`/${resource}/me/`, data)
|
||||
},
|
||||
checkPassword(value) {
|
||||
return repository.post(`/${resource}/me/password/`, { password: value })
|
||||
},
|
||||
|
||||
@@ -163,7 +163,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
}
|
||||
|
||||
async function updateAccount(data) {
|
||||
return accountsApi.patch(authUser.value.pk, data).then((response) => {
|
||||
return accountApi.updateMe(data).then((response) => {
|
||||
const newAuthUser = { ...authUser.value, ...response.data }
|
||||
delete newAuthUser.password
|
||||
authUser.value = { ...newAuthUser }
|
||||
|
||||
Reference in New Issue
Block a user