Commit df9486f9 authored by nanahira's avatar nanahira

fix

parent 0edb9535
Pipeline #5865 passed with stages
in 28 seconds
...@@ -56,10 +56,6 @@ export const UpdateProfiles = async (ctx: Context) => { ...@@ -56,10 +56,6 @@ export const UpdateProfiles = async (ctx: Context) => {
ctx.throw(400); ctx.throw(400);
} }
const targetUser = {
name: ctx.request.body.name || user.name,
avatar: ctx.request.body.avatar || user.avatar,
};
const userRep = getEntityManager().getRepository(User); const userRep = getEntityManager().getRepository(User);
...@@ -73,6 +69,11 @@ export const UpdateProfiles = async (ctx: Context) => { ...@@ -73,6 +69,11 @@ export const UpdateProfiles = async (ctx: Context) => {
return ctx.throw('i_user_unexists', 400); return ctx.throw('i_user_unexists', 400);
} }
const targetUser = {
name: ctx.request.body.name || _user.name,
avatar: ctx.request.body.avatar || _user.avatar,
};
Object.assign(_user, targetUser); Object.assign(_user, targetUser);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment