public ActionResult AssigningSharedCollection([FromBody] JsonElement json) { string authHeader = this.HttpContext.Request.Headers["Authorization"]; TokenModel tokenModel = new TokenModel(); ClaimsPrincipal auth = tokenModel.GetPrincipal(authHeader); if (auth.Identity.IsAuthenticated) { new ClickTracker("AssigningSharedCollection", false, true, json.GetRawText(), auth.Identity.Name); NewCollectionsObj obj = JsonConvert.DeserializeObject <NewCollectionsObj>(json.GetRawText()); CollectionSharing sharing = new CollectionSharing(); return(Ok(sharing.AddUserToCollection(obj))); } return(Ok("")); }
public ActionResult SetSharedCollection(string collectionId) { string authHeader = this.HttpContext.Request.Headers["Authorization"]; TokenModel tokenModel = new TokenModel(); ClaimsPrincipal auth = tokenModel.GetPrincipal(authHeader); if (auth.Identity.IsAuthenticated) { new ClickTracker("SetSharedCollection", false, true, "collectionId " + collectionId, auth.Identity.Name); CollectionSharing collectionSharing = new CollectionSharing(collectionId); return(Ok(new ReturnModel() { result = true, returnStr = collectionSharing.CollectionSharingId })); } return(Ok("")); }