fix wrong stuff coming back after updating user
This commit is contained in:
parent
19981cb223
commit
9761ac21e0
|
@ -27,7 +27,9 @@
|
||||||
|
|
||||||
// Update user!
|
// Update user!
|
||||||
async function updateUser(event) {
|
async function updateUser(event) {
|
||||||
const response = await api.put(`/api/users`, event.detail)
|
let data = event.detail
|
||||||
|
delete data.password
|
||||||
|
const response = await api.put(`/api/users`, data)
|
||||||
const users = await response.json()
|
const users = await response.json()
|
||||||
backendUiStore.update(state => {
|
backendUiStore.update(state => {
|
||||||
state.users = users
|
state.users = users
|
||||||
|
|
|
@ -70,15 +70,11 @@ exports.update = async function(ctx) {
|
||||||
const response = await db.put(user)
|
const response = await db.put(user)
|
||||||
user._rev = response.rev
|
user._rev = response.rev
|
||||||
|
|
||||||
|
console.log(response)
|
||||||
|
|
||||||
ctx.status = 200
|
ctx.status = 200
|
||||||
ctx.body = {
|
ctx.message = `User ${ctx.request.body.username} updated successfully.`
|
||||||
message: `User ${ctx.request.body.username} updated successfully.`,
|
ctx.body = response
|
||||||
user: {
|
|
||||||
...user,
|
|
||||||
_rev: response.rev,
|
|
||||||
_id: response.id,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.destroy = async function (ctx) {
|
exports.destroy = async function (ctx) {
|
||||||
|
|
Loading…
Reference in New Issue