public IHttpActionResult UnsetAdmin([FromBody] JObject request) { Repo <Group> cr = new GroupRepo(); Group group = request.ToObject <Group>(); group.Admin = null; cr.Update(group); return(Ok()); }
public IHttpActionResult UnPinMessage([FromBody] JObject request) { Message msg = request["message"].ToObject <Message>(); Repo <Group> cr = new GroupRepo(); Group group = request["group"].ToObject <Group>(); group.PinnedMessage = null; cr.Update(group); return(Ok()); }
public IHttpActionResult ChangeAdmin([FromBody] JObject request) { User conv = request["user"].ToObject <User>(); Repo <Group> cr = new GroupRepo(); Group group = request["group"].ToObject <Group>(); group.Admin = conv; cr.Update(group); return(Ok()); }