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

12 batch user update #77

Merged
merged 7 commits into from
Mar 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
removed some logging
  • Loading branch information
jzakotnik committed Mar 25, 2024
commit 805878b5594135af1c1700f294a3cf42f1eebcf5
6 changes: 3 additions & 3 deletions pages/user/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ export default function Users({ users, books, rentals }: UsersPropsType) {
Object.values(checked).some((value) => value === true)
? (resultCheck = false)
: (resultCheck = true);
console.log("Selecting or deselecting all users ", users);
//console.log("Selecting or deselecting all users ", users);
const newChecked = users.reduce((acc: any, u: any) => {
if (u.id !== undefined) {
acc = { ...acc, [u.id]: resultCheck };
}
return acc;
}, {});
console.log("New checked users", newChecked);
//console.log("New checked users", newChecked);
setChecked(newChecked);
};

Expand All @@ -123,7 +123,7 @@ export default function Users({ users, books, rentals }: UsersPropsType) {
};

const handleIncreaseGrade = () => {
console.log("Increasing grade for users ", users, checked);
//console.log("Increasing grade for users ", users, checked);
//the user IDs that are checked are marked as true
const updatedUserIDs = users.reduce((acc: any, u: UserType) => {
if (checked[u.id!])
Expand Down