Skip to content

Commit

Permalink
Merge pull request #235 from nwplus/query-fixes
Browse files Browse the repository at this point in the history
fix table swap issues, add meal data
  • Loading branch information
meleongg authored Feb 29, 2024
2 parents af99fc7 + eed0d0a commit 6980ea2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pages/[id]/HackerInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default function HackerInfo({ id, hackathons }) {
useEffect(() => {
clearFilters()
getHackerInfo(setUnfilteredData, id, currTable)
}, [currTable])
}, [currTable, id])

useEffect(() => {
if (unfilteredData.length > 0) {
Expand Down
8 changes: 7 additions & 1 deletion utility/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ const returnTrueKey = obj => {
// Specifically for hacker info page - fixes/removes certain fields for table display
export const filterHackerInfoFields = (obj, collection) => {
let newObj = {}
delete obj.questionnaire.eventsAttended
if (collection === 'Applicants') {
delete obj.questionnaire?.eventsAttended
newObj = {
id: obj._id,
...obj.basicInfo,
Expand All @@ -72,6 +72,12 @@ export const filterHackerInfoFields = (obj, collection) => {
newObj.MLHCodeOfConduct = obj.termsAndConditions?.MLHCodeOfConduct
newObj.MLHPrivacyPolicy = obj.termsAndConditions?.MLHPrivacyPolicy
newObj.MLHEmailSubscription = obj.termsAndConditions?.MLHEmailSubscription
newObj.day1Breakfast = obj.dayOf?.day1?.breakfast?.length || 0
newObj.day1Lunch = obj.dayOf?.day1?.lunch?.length || 0
newObj.day1Dinner = obj.dayOf?.day1?.dinner?.length || 0
newObj.day2Breakfast = obj.dayOf?.day2?.breakfast?.length || 0
newObj.day2Lunch = obj.dayOf?.day2?.lunch?.length || 0
newObj.day2Dinner = obj.dayOf?.day2?.dinner?.length || 0
} else if (collection === 'Projects') {
newObj = { ...obj }
delete newObj.grades
Expand Down

0 comments on commit 6980ea2

Please sign in to comment.