public async Task <ActionResult> PoolListing() { var item = await PaytopiaReader.GetItem(PaytopiaItemType.PoolListing); var items = await PaytopiaReader.GetPoolListingItems(); var balance = await UserBalanceReader.GetBalance(User.Identity.GetUserId(), item.CurrencyId); return(View("PoolListingModal", new PoolListingModel { Balance = balance?.Available ?? 0, Currency = item.Symbol, Price = item.Price, Name = item.Name, Items = items, Description = item.Description })); }
public async Task <ActionResult> PoolListing(PoolListingModel model) { if (!model.IsListed && !ModelState.IsValid) { model.Items = await PaytopiaReader.GetPoolListingItems(); return(View("PoolListingModal", model)); } ModelState.Clear(); var result = await PaytopiaWriter.UpdatePoolListing(User.Identity.GetUserId(), model); if (!ModelState.IsWriterResultValid(result)) { model.Items = await PaytopiaReader.GetPoolListingItems(); return(View("PoolListingModal", model)); } return(CloseModal(result)); }