Update
/api/v2/room/update
Post
rooms
jwt
Purpose
To allow a user to update an existing chat room.
Body Content [input]
{
uid: string,
roomID: string,
name: string,
description: string,
icon: string,
privacy: string
}
Returns if valid [output]
{
message: string,
error: 0
}
What the API does
- Finds the
roombeing referenced by theroomIDpassed [404]. - Ensures that
uidcorresponds to a record in themembersfield with astatusofacceptedand has a value oftruefor itsis_adminfield [403]. - Updates and saves the
roomwith the new value(s) forname,description,iconand/orprivacy. - Generates and saves a new object in the
messagesfield of theroomusingmessageID, “Some details about this room have been updated” asmessage,timestampascreated_onandmodified_on, “_system” assenderID,falseforis_deletedand an empty array forviewsifoperationis set toblock.