Skip to content

Commit

Permalink
feat: total count 업데이트 (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
HSjjs98 committed Jul 7, 2024
1 parent 5083191 commit 289d6a0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pages/Members/Members.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class MembersPage extends Container {

isLoggedIn().then((loggedIn) => {
if (loggedIn) {
this.resetSearch();
this.getMember();
}
});
}
Expand Down Expand Up @@ -67,6 +67,7 @@ export default class MembersPage extends Container {
this.total = total;
this.renderPagination();
this.renderTable();
this.updateTotalCount();
})
.catch((error) => {
console.error('Failed to search members:', error.message);
Expand All @@ -81,6 +82,7 @@ export default class MembersPage extends Container {
this.total = total;
this.renderPagination();
this.renderTable();
this.updateTotalCount();
})
.catch((error) => {
console.error('Failed to load page data:', error);
Expand All @@ -93,6 +95,13 @@ export default class MembersPage extends Container {
this.getMember();
};

updateTotalCount = () => {
document.querySelectorAll('.members-container em').forEach((em) => {
// eslint-disable-next-line no-param-reassign
em.innerText = this.total;
});
};

renderPagination = () => {
this.pagination = new Pagination({
currentPage: this.currentPage,
Expand Down

0 comments on commit 289d6a0

Please sign in to comment.