Open christopherjohnson1 opened 4 years ago
As a user, I should be able to edit my missions.
WHEN the missions page loads THEN I should be able to edit a mission AND it should not create a new entry in the database, only edit an existing one
editMission.js
missions.js
buildAllMissions
id="edit-missions-btn"
editMissionForm
domString
updateMissionItem
updateMissions
missionsData.js
axios.post()
e
e.preventDefault()
console.error
editedMission
USER STORY
As a user, I should be able to edit my missions.
AC
WHEN the missions page loads THEN I should be able to edit a mission AND it should not create a new entry in the database, only edit an existing one
DEV NOTES
editMission.js
editMission.js
missions.js
file inbuildAllMissions
withid="edit-missions-btn"
editMissionForm
editMissionForm
callededitMissionForm
domString
variableupdateMissionItem
missions.js
create the functionupdateMissionItem
updateMissions
function inmissionsData.js
axios.post()
to send to databaseupdateMissionItem
function - takese
as a parametere.preventDefault()
updateMissions
functionconsole.error
and comment and the erroreditedMission
with as many key:value pairs as there arebuildAllMissions
function