-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Business Donation History Resolved #36
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job jits. y'all cooked. pretty minor changes. try to get them done by monday so we can merge. 😗
<Td>{item.reporter}</Td> | ||
<Td>{item.food_bank_donation}</Td> | ||
<Td>{item.date}</Td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iterate through the columns rather than explicitly accessing each column. see BusinessTable for an example.
const { backend } = useBackend(); | ||
const [data, setData] = useState([]); | ||
const [selectedDonationId, setSelectedDonationId] = useState(null); | ||
const TABLE_HEADERS = ['reporter', 'food_bank_donation', 'date', 'action']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: format cleanly since these are the values that appear to the user
// ViewBusiness.PropTypes = { | ||
// id: PropTypes.number.isRequired, | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete commented code if you're not using it
console.log(`Fetching donation details for ID: ${id}`); | ||
const response = await backend.get(`/donation/${id}`); | ||
setData(response.data); | ||
console.log('Response received:', response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unnecessary console.logs
try { | ||
setSelectedDonationId(id); | ||
const response = await backend.get(`/donation/${id}`); | ||
console.log(response.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unnecessary console.log
} | ||
}; | ||
getData(); | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
React Hook useEffect has a missing dependency: 'backend'. Either include it or remove the dependency array.
if (id) { | ||
fetchDonation(); | ||
} | ||
}, [id]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
React Hook useEffect has a missing dependency: 'fetchDonation'. Either include it or remove the dependency array.
resolves #33