correct put call to not remove password 😅
This commit is contained in:
parent
f25ae8750d
commit
5e8909cf0e
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<div class="inputs">
|
<div class="inputs">
|
||||||
<Input
|
<Input
|
||||||
disabled={!editMode}
|
disabled
|
||||||
thin
|
thin
|
||||||
bind:value={user.username}
|
bind:value={user.username}
|
||||||
name="Name"
|
name="Name"
|
||||||
|
|
|
@ -66,8 +66,10 @@ exports.create = async function(ctx) {
|
||||||
exports.update = async function (ctx) {
|
exports.update = async function (ctx) {
|
||||||
const db = new CouchDB(ctx.user.instanceId)
|
const db = new CouchDB(ctx.user.instanceId)
|
||||||
const user = ctx.request.body
|
const user = ctx.request.body
|
||||||
|
const dbUser = db.get(ctx.request.body._id)
|
||||||
|
const newData = { ...dbUser, ...user }
|
||||||
|
|
||||||
const response = await db.put(user)
|
const response = await db.put(newData)
|
||||||
user._rev = response.rev
|
user._rev = response.rev
|
||||||
|
|
||||||
ctx.status = 200
|
ctx.status = 200
|
||||||
|
|
Loading…
Reference in New Issue