| Version 4 (modified by , 19 hours ago) ( diff ) |
|---|
Remove component from build
Actors
User, Admin
Scenario
- In the forge, after the user chooses the desired existing component they click on the trash can icon
- The server removes the component from the build
BEGIN; SELECT * FROM build WHERE id = $buildId AND user_id = $userId LIMIT 1; DELETE FROM build_component WHERE build_id = $buildId AND component_id = $componentId; SELECT c.price FROM build_component bc JOIN components c ON c.id = bc.component_id WHERE bc.build_id = $buildId; UPDATE build SET total_price = ( SELECT COALESCE(ROUND(SUM(c.price), 2), 0) FROM build_component bc JOIN components c ON c.id = bc.component_id WHERE bc.build_id = $buildId ) WHERE id = $buildId; COMMIT;
Attachments (2)
- deletedComp.png (103.7 KB ) - added by 19 hours ago.
- trashIcon.png (123.3 KB ) - added by 19 hours ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.

