Example #1
0
        public async Task <IActionResult> SetBaseAssetAsync([FromBody] UpdateBaseAssetRequest model)
        {
            try
            {
                MerchantSetting merchantSettings = await _merchantSettingService.GetByIdAsync(model.MerchantId);

                merchantSettings.BaseAsset = model.BaseAsset;

                await _merchantSettingService.SetAsync(merchantSettings);

                return(Ok());
            }
            catch (MerchantSettingNotFoundException ex)
            {
                _log.WarningWithDetails(ex.Message, model);

                return(NotFound(ErrorResponse.Create(ex.Message)));
            }
            catch (AssetNotAvailableForMerchantException ex)
            {
                _log.WarningWithDetails(ex.Message, model);

                return(BadRequest(ErrorResponse.Create(ex.Message)));
            }
        }
 public Task SetBaseAssetAsync(UpdateBaseAssetRequest model)
 {
     return(_runner.RunAsync(() => _merchantSettingsApi.SetBaseAssetAsync(model)));
 }