| Version 6 (modified by , 37 hours ago) ( diff ) |
|---|
Clone an existing build
Actors
User, Admin
Scenario
- The user opens the completed builds page, opens the details popup for a build
- The user clicks on the "CLONE & EDIT" button and is redirected to the forge page
- The forge is populated with identical data as the build that was cloned
BEGIN; SELECT b.id b.id, b.name, b.description, b.total_price, b.is_approved FROM builds b WHERE id = $buildId LIMIT 1; INSERT INTO builds (user_id, name, created_at, description, total_price, is_approved) VALUES ( $userId, $buildToClone_name || ' (copy)', CURRENT_TIMESTAMP, $buildToClone.description, $buildToClone.total_price, false ) RETURNING id AS $new_build_id; SELECT component_id FROM build_components WHERE build_id = $buildId; INSERT INTO build_components (build_id, component_id) VALUES ($new_build_id, $existing_component_id); COMMIT;
BEGIN; SELECT b.id, b.user_id, b.is_approved, b.name, b.description, b.total_price, FROM builds b WHERE b.id = $1 AND b.user_id = $2 LIMIT 1; SELECT bc.component_id FROM build_components bc WHERE bc.build_id = $1; COMMIT;
Attachments (3)
- clonedBuild.png (142.5 KB ) - added by 2 days ago.
- clickClone.png (221.9 KB ) - added by 44 hours ago.
- clone.png (203.5 KB ) - added by 44 hours ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.



