Skip to content
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

Merged
merged 3 commits into from
Feb 20, 2024
Merged

Conversation

benson-fm
Copy link
Collaborator

resolves #33

Copy link
Contributor

@srukelman srukelman left a 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. 😗

Comment on lines +53 to +55
<Td>{item.reporter}</Td>
<Td>{item.food_bank_donation}</Td>
<Td>{item.date}</Td>
Copy link
Contributor

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'];
Copy link
Contributor

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

Comment on lines 22 to 24
// ViewBusiness.PropTypes = {
// id: PropTypes.number.isRequired,
// }
Copy link
Contributor

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

Comment on lines 13 to 16
console.log(`Fetching donation details for ID: ${id}`);
const response = await backend.get(`/donation/${id}`);
setData(response.data);
console.log('Response received:', response);
Copy link
Contributor

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);
Copy link
Contributor

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();
}, []);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <react-hooks/exhaustive-deps> reported by reviewdog 🐶
React Hook useEffect has a missing dependency: 'backend'. Either include it or remove the dependency array.

if (id) {
fetchDonation();
}
}, [id]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <react-hooks/exhaustive-deps> reported by reviewdog 🐶
React Hook useEffect has a missing dependency: 'fetchDonation'. Either include it or remove the dependency array.

@MaanPatel2005 MaanPatel2005 merged commit e96b8ee into main Feb 20, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Business Donation History
5 participants