public async Task <IActionResult> Delete(ObjectTypePropertyDeleteGet ContentTypeProperty) { var CurrentUser = await _userManager.GetUserAsync(User); if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString())) { ContentTypeProperty.UserId = CurrentUser.Id; //var CheckString = await _ContentTypePropertyProvider.DeletePostCheck(ContentTypeProperty); //if (CheckString.Length == 0) //{ _contentTypePropertyProvider.DeletePost(CurrentUser.Id, ContentTypeProperty.ObjectTypePropertyId); return(Ok(ContentTypeProperty)); //} return(BadRequest(new { IsSuccess = false, //Message = CheckString, })); } return(BadRequest(new { IsSuccess = false, Message = "No rights", })); }
public async Task <IActionResult> Delete(ObjectTypePropertyDeleteGet ProjectTypeProperty) { var token = HttpContext.Session.GetString("Token"); if (token == null) { return(RedirectToAction("Login", "FrontAuth")); } await _client.PostProtectedAsync <ObjectTypePropertyDeleteGet>($"{_configuration["APIUrl"]}api/ProjectTypeProperty/Delete", ProjectTypeProperty, token); return(RedirectToAction("Index", new { id = ProjectTypeProperty.ObjectTypeId })); }