public void UpdateFavoriteLabel(long favoriteLabelId, FavoriteLabelContractBase data) { try { m_client.Put <object>($"favorite/label/{favoriteLabelId}", data); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public long CreateFavoriteLabel(FavoriteLabelContractBase data) { try { var result = m_client.Post <long>("favorite/label", data); return(result); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public CreateOrUpdateFavoriteLabelWork(FavoritesRepository favoritesRepository, FavoriteLabelContractBase data, int userId, long?favoriteLabelId, bool createDefault = false) : base(favoritesRepository) { m_favoritesRepository = favoritesRepository; m_data = data; m_userId = userId; m_favoriteLabelId = favoriteLabelId; m_createDefault = createDefault; }
public void UpdateFavoriteLabel(long labelId, FavoriteLabelContractBase data) { var userId = m_authenticationManager.GetCurrentUserId(); new CreateOrUpdateFavoriteLabelWork(m_favoritesRepository, data, userId, labelId).Execute(); }
public IActionResult UpdateFavoriteLabel(long favoriteLabelId, [FromBody] FavoriteLabelContractBase data) { m_favoriteManager.UpdateFavoriteLabel(favoriteLabelId, data); return(Ok()); }
public IActionResult CreateFavoriteLabel([FromBody] FavoriteLabelContractBase data) { var resultId = m_favoriteManager.CreateFavoriteLabel(data); return(Ok(resultId)); }