botblock / BotBlock.org

BotBlock - The List of Discord Bot Lists and Services
https://botblock.org/
Mozilla Public License 2.0
28 stars 8 forks source link

Editing a list should use a DB update call #48

Closed MattIPv4 closed 4 years ago

MattIPv4 commented 4 years ago

Website/API Suggestion

Description

The list edit functionality should use an update call on the database to apply any changes from the POST submission, not the current delete/insert logic.

Why

Delete/insert leaves the site vulnerable to data loss if the insert fails, as the previous version of the list has already been deleted. By using an update, if it fails, the old version of the data remains.