|
|
@ -21,12 +21,14 @@ export async function updateChat(req, res){ |
|
|
|
if(!chat) { |
|
|
|
return failure(res,'chat not found') |
|
|
|
} |
|
|
|
const {name,photo_url,meta} = req.body |
|
|
|
const {name,photo_url,meta,my_alias,my_photo_url} = req.body |
|
|
|
|
|
|
|
const obj:{[k:string]:any} = {} |
|
|
|
if(name) obj.name=name |
|
|
|
if(photo_url) obj.photoUrl=photo_url |
|
|
|
if(meta && typeof meta==='string') obj.meta=meta |
|
|
|
if(my_alias) obj.myAlias=my_alias |
|
|
|
if(my_photo_url) obj.myPhotoUrl=my_photo_url |
|
|
|
|
|
|
|
if(Object.keys(obj).length>0) { |
|
|
|
await chat.update(obj) |
|
|
|