public async Task <IActionResult> AddBouqetToStore(int storeId, BouqetUpsertInput input) { _logger.LogInformation($"Creating a bouqet for store {storeId}"); try { var persistedBouqet = await _bouquetRepository.Insert(storeId, input.Name, input.Price, input.Description); return(Created($"/stores/{storeId}/bouqets/{persistedBouqet.Id}", persistedBouqet.Convert())); } catch (NotFoundException) { return(NotFound()); } }
public async Task <IActionResult> UpdateBouqetToStore(int storeId, int bouqetId, BouqetUpsertInput input) { _logger.LogInformation($"Updating bouqet {bouqetId} for store {storeId}"); try { await _bouquetRepository.Update(storeId, bouqetId, input.Name, input.Price); return(Accepted()); } catch (NotFoundException) { return(NotFound()); } }