public async Task <IActionResult> CreateFlowerShop(FlowerShopUpsertInput input) { _logger.LogInformation("Creating a flowershop", input); try{ var persistedShop = await _shops.Insert(input.shopName, input.streetName, input.houseNumber, input.city, input.postalCode, input.phoneNumber, input.email); return(Created($"/shops/{persistedShop.id}", persistedShop.Convert())); } catch (NotFoundException) { return(NotFound()); } }
public async Task <IActionResult> UpdateFlowerShop(int id, FlowerShopUpsertInput input) { _logger.LogInformation("Updating a flowershop", input); try { await _shops.Update(id, input.shopName, input.streetName, input.houseNumber, input.city, input.postalCode, input.phoneNumber, input.email); return(Accepted()); } catch (NotFoundException) { return(NotFound()); } }