== Add/remove build from favorites == === Actors === User, Admin === Scenario === 1. The user opens the completed builds page, opens the details popup for a build [[Image(showBuildDetails.png)]] 2. The user can click on the "ADD TO FAVORITES" button to toggle whether the build is favorited or not {{{ SELECT 1 FROM favorite_build WHERE user_id = $userId AND build_id = $buildId LIMIT 1; -- if favorite DELETE FROM favorite_build WHERE user_id = $userId AND build_id = $buildId; -- if NOT favorite INSERT INTO favorite_build (user_id, build_id) VALUES ($userId, $buildId); }}} [[Image(favorited.png)]]