When selecting assets with the map draw tool, a user can re-select an asset that they've already selected. This duplicates the asset so that the asset shows up one or more times for a phase.
Exposed in #252.
Fix
If a user has already selected an asset, then some logic should prevent the same asset from being submitted to the API. This should happen in the javascript code that prepares the assets to be submitted to the API. The SelectAssetsMap.js component submits the data to the API, and the GeometrySelector component parses out the assets from the selected region. You'll need to add some helper code to the GeometrySelector that compares the selected assets with the phase's existing assets, and only include the selected asset in the payload that's submitted to the API.
Completed
This issue will be completed when a user can select and save the same asset in the map multiple times without duplicating the asset in the database.
Bug description
When selecting assets with the map draw tool, a user can re-select an asset that they've already selected. This duplicates the asset so that the asset shows up one or more times for a phase.
Exposed in #252.
Fix
If a user has already selected an asset, then some logic should prevent the same asset from being submitted to the API. This should happen in the javascript code that prepares the assets to be submitted to the API. The
SelectAssetsMap.js
component submits the data to the API, and theGeometrySelector
component parses out the assets from the selected region. You'll need to add some helper code to theGeometrySelector
that compares the selected assets with the phase's existing assets, and only include the selected asset in the payload that's submitted to the API.Completed
This issue will be completed when a user can select and save the same asset in the map multiple times without duplicating the asset in the database.