sharetribe / harmony

Availability management backend and API for Sharetribe marketplaces
https://www.sharetribe.com
Apache License 2.0
19 stars 11 forks source link

Don't crash if there are no blocks to delete #37

Closed rap1ds closed 7 years ago

rap1ds commented 7 years ago

This PR fixes an issue which may occure if client sends deleteBlocks request with block IDs that don't exist anymore.

Steps to reproduce:

To reproduce the issue, you need to have two tabs open.

  1. In tab 1, go to listing page, open availability calendar
  2. In tab 1, block one day and save
  3. In tab 1, reopen the calendar
  4. In tab 2, go to listing page, open availability calendar
  5. In tab 2, delete one blocked day and save
  6. In tab 1, try to delete the same blocked day and save

Expected result: Success

Actual result: The delete operation fails because the block has been delete already (in tab 2)