Team details settings page

This commit is contained in:
Tom Moor
2018-05-31 12:44:32 -07:00
parent fb7a8f0312
commit 10a0ffe472
12 changed files with 226 additions and 18 deletions

View File

@ -21,11 +21,10 @@ router.post('user.update', auth(), async ctx => {
const endpoint = publicS3Endpoint();
if (name) user.name = name;
if (
avatarUrl &&
avatarUrl.startsWith(`${endpoint}/uploads/${ctx.state.user.id}`)
)
if (avatarUrl && avatarUrl.startsWith(`${endpoint}/uploads/${user.id}`)) {
user.avatarUrl = avatarUrl;
}
await user.save();
ctx.body = { data: await presentUser(ctx, user) };