Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Oshanath committed Mar 22, 2021
1 parent cc3ba94 commit 98147fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Controllers/threadController.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,16 @@ module.exports.getThreadData_post = (req, res) => {
}

if(filter.status == 'unread'){

}
else if(filter.status != 'allStatus')
searchQuery['status'] = filter.status;

if(filter.type != 'allReqType')
searchQuery['type'] = filter.type;



let filterThreads = async (thread, filter) => {
let string = filter.string.toLowerCase();
let searchWords = string.split(' ');
Expand Down
4 changes: 4 additions & 0 deletions public/assets/javascript/threadView.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ let getThreads = () => {
// loading page open
document.querySelector('.bouncer.left').classList.toggle('active');

console.log(filter);
console.log("here");

replyButton.className = 'replyBtn';
replyButtons.className = 'reply-btn-group';

Expand All @@ -92,6 +95,7 @@ let getThreads = () => {
.then(response => response.json())
.then(data => {
threads = data.array;
console.log(threads);
numberOfPages = data.numberOfPages;
initNav();

Expand Down
4 changes: 2 additions & 2 deletions public/threadView.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@

<div class="tab">
<a href="#" class="closebtn" onclick="closeNav()">&times;</a>
<button class="tablinks status" id="allStatus">All</button>
<button class="tablinks status selectedTablink" id="allStatus">All</button>
<button class="tablinks status" id="active">Active</button>
<button class="tablinks status" id="accepted">Accepted</button>
<button class="tablinks status" id="declined">Declined</button>
<button class="tablinks status" id="unread">Unread
<span class="material-icons">mark_as_unread</span>
</button>
<div class="dropdown-container">
<button class="tablinks reqType" id="allReqType">All</button>
<button class="tablinks reqType selectedTablink" id="allReqType">All</button>
<button class="tablinks reqType" id="addDrop">Add Drop</button>
<button class="tablinks reqType" id="submission">Submission</button>
<button class="tablinks reqType" id="repeat">Repeat Exam</button>
Expand Down

0 comments on commit 98147fa

Please sign in to comment.