Open ndswimming92 opened 7 months ago
Users can click a "Delete" button on a note card to remove a note.
The app sends a DELETE request to the server with the unique ID of the note to be deleted.
The server deletes the note from the database.
The app receives a success response, and the note is removed from the list of notes on the home page.
function MemberCard({ memberObj, onUpdate }) { const deleteAMember = () => { if (window.confirm(`Are you sure you want to delete ${memberObj.name}?`)) { deleteMember(memberObj.firebaseKey).then(() => onUpdate()); } }; return ( <Card style={{ width: '20rem', margin: '10px' }}> <Card.Img variant="top" src={memberObj.image} alt={memberObj.image} style={{ height: '400px' }} /> <Card.Body> <Card.Title>{memberObj.name}</Card.Title> <p className="card-text bold">{memberObj.role}</p> {/* DYNAMIC LINK TO VIEW THE Member DETAILS */} <Link href={`/member/${memberObj.firebaseKey}`} passHref> <Button variant="primary" className="m-2">VIEW</Button> </Link> {/* DYNAMIC LINK TO EDIT THE Member DETAILS */} <Link href={`/member/edit/${memberObj.firebaseKey}`} passHref> <Button variant="info">EDIT</Button> </Link> <Button variant="danger" onClick={deleteAMember} className="m-2"> DELETE </Button> </Card.Body> </Card> ); }
User Story - what the user should see and experience
Users can click a "Delete" button on a note card to remove a note.
The app sends a DELETE request to the server with the unique ID of the note to be deleted.
The server deletes the note from the database.
The app receives a success response, and the note is removed from the list of notes on the home page.
Acceptance Criteria - illustrates the scope of the individual ticket
Example -
Dependencies -
Dev Notes - dev work that needs to be completed for this ticket