public async Task <IActionResult> SetDefault(string assetPairId, [FromBody] UpdateMarkupRequest request) { if (!string.IsNullOrEmpty(request.PriceAssetPairId)) { AssetPair priceAssetPair = await _assetsLocalCache.GetAssetPairByIdAsync(request.PriceAssetPairId); if (priceAssetPair == null) { return(NotFound(ErrorResponse.Create("Price asset pair doesn't exist"))); } } try { await _markupService.SetDefaultAsync(assetPairId, request.PriceAssetPairId, request.PriceMethod, request); return(Ok()); } catch (Exception ex) { await _log.WriteErrorAsync(nameof(MarkupsController), nameof(SetDefault), ex); throw; } }
public async Task <IActionResult> SetDefault(string assetPairId, [FromBody] UpdateMarkupRequest request) { if (!string.IsNullOrEmpty(request.PriceAssetPairId)) { AssetPair priceAssetPair = await _assetsLocalCache.GetAssetPairByIdAsync(request.PriceAssetPairId); if (priceAssetPair == null) { return(NotFound(ErrorResponse.Create("Price asset pair doesn't exist"))); } } try { await _markupService.SetDefaultAsync(Uri.UnescapeDataString(assetPairId), request.PriceAssetPairId, request.PriceMethod, request); return(Ok()); } catch (InvalidRowKeyValueException e) { _log.ErrorWithDetails(e, new { e.Variable, e.Value }); return(NotFound(ErrorResponse.Create("Asset pair not found"))); } }