Denhac / denhac-webhooks

This repo holds some of our membership automation stuff. It listens to webhooks from the main wordpress site
7 stars 2 forks source link

[Slack][CreateTrainableEquipment] Form does not prevent duplicate submissions #70

Open chungl opened 3 months ago

chungl commented 3 months ago

Discovered in relation to #69, there is nothing preventing the user from creating redundant pieces of trainable equipment if they submit the form twice or just submit equipment that already exists.

There should be a uniqueness check prior to form submission, and equipment with the same name (case insensitive) should be rejected with an error message that explains that equipment with this name already exists.

Bonus: Ideally we'd do a fuzzy search and warn/prompt for confirmation if similar equipment already exists. EG: There have been two forges ("forge safety" and "forge") and three wood lathes ("wood lathe", "jet lathe", and "jet wood lathe") that have been created independently by different people. Since non-user/trainers cannot browse the full list of equipment, there is nothing but tribal knowledge or database access that tells a well-wishing contributor that a piece of equipment already exists.