public async Task <IActionResult> CreateOneBookmarkAsync([FromBody] BookmarkAttribute bookmark) { /* * { * "userId": "1234", * "contentTypeId": 3, * "contentId": 1, * "title": "DK Test4", * "url": "http://www.newhomesource.com", * "action": "Saved" * } */ try { var res = await _service.CreateOneBookmarkAsync(bookmark); if (!string.IsNullOrEmpty(res.ErrorMessage)) { throw new Exception(res.ErrorMessage); } return(Ok(res)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task <IActionResult> UpdateOneBookmarkAsync([FromBody] BookmarkAttribute bookmark) { /* * { * "userId": "1234", * "contentTypeId": 3, // This doesn't change for some reason * "contentId": 1, * "title": "DK Test4---", * "url": "http://www.newhomesource.com", * "action": "Saved", * "notes": ["new",""home] * } */ try { var res = await _service.UpdateOneBookmarkAsync(bookmark); if (!res.Result) { throw new Exception(res.ErrorMessage); } return(Ok(res)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task <GenericAPIModel <bool> > UpdateBookmark(BookmarkAttribute param) { try { return(await _userDetails.UpdateBookmark(param)); } catch (Exception e) { throw e; } }
public Task <ApiResultModel <bool> > UpdateOneBookmarkAsync(BookmarkAttribute bookmark) { var request = new RestRequest("User/UpdateBookmark", Method.POST, DataFormat.Json); request.AddJsonBody(bookmark); return(_http.SendRequestAsync <ApiResultModel <bool> >(request)); }
public Task <ApiResultModel <bool> > UpdateOneBookmarkAsync(BookmarkAttribute bookmark) { try { return(_repo.UpdateOneBookmarkAsync(bookmark)); } catch (Exception e) { throw e; } }
public async Task <IActionResult> UpdateBookMark([FromBody] BookmarkAttribute param) { // Debug.WriteLine(param.LogonName + "\n"); try { return(Ok(await _userDetails.UpdateBookmark(param))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task <GenericAPIModel <int> > CreateBookmark(BookmarkAttribute param) { try { var request = new RestRequest("User/CreateBookmark", Method.POST, DataFormat.Json); request.AddJsonBody(param); // Debug.WriteLine("\nParams--> " + param.LogonName + " " + param.UserId); Debug.WriteLine(".......................That was create bookmark url........................."); var result = await restClient.ExecuteAsync <GenericAPIModel <int> >(request); Debug.WriteLine("\nThis is the data returned" + result.Data + " ===> " + result.Content); return(result.Data); } catch (Exception e) { throw e; } }