Skip to content

Commit

Permalink
fixed update clearance status for dept heads
Browse files Browse the repository at this point in the history
  • Loading branch information
nati-m-afw committed Mar 10, 2021
1 parent 021804d commit 9383d8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion assets/js/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ onload = function (){

// Display loan transaction data into UI loan.html
try {
displayTransactions();
personalizeTableHeader();
displayTransactions();
} catch (error){
console.log();
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/personalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function personalizeTableHeader(){
const deptColumn = document.createElement('th')
const allColumn = document.createElement('th')

document.querySelector('.search-bar').children[1].style.display = 'none'
// document.querySelector('.search-bar').children[1].style.display = 'none'

tableHeaderA.firstElementChild.appendChild(deptColumn)
tableHeaderA.firstElementChild.appendChild(allColumn)
Expand Down
10 changes: 5 additions & 5 deletions assets/js/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function displayClearanceRequests(){
tableRow.appendChild(statusColumn);
tableRow.appendChild(editColumn);
tableBody.appendChild(tableRow);

studentIdColumn.textContent = request.result.studentId;
firstNameColumn.textContent = request.result.firstName;
lastNameColumn.textContent = request.result.lastName;
Expand All @@ -77,18 +76,19 @@ function displayClearanceRequests(){

}

function getClearanceModal(){
function getClearanceModal(e){
var editBtn = e.target
const updateBtn = document.querySelector('#updateClearanceStatusButton')
updateBtn.addEventListener('click', updateClearanceStatus)
document.querySelector('#modalId').textContent = editBtn.parentElement.parentElement.firstElementChild.textContent
}

function updateClearanceStatus(){
function updateClearanceStatus(e){
console.log(editBtn.parentElement.parentElement.firstElementChild);
const clearedRadioBtn = document.querySelector('.form-check-input-cleared')
const rejectedRadioBtn = document.querySelector('.form-check-input-rejected')
const descriptionTextArea = document.querySelector('.form-control-description')
const studentId = editBtn.parentElement.parentElement.firstElementChild.textContent

const studentId = document.querySelector('#modalId').textContent
let transaction = db.transaction(['clearanceOS'], 'readwrite');
let objectStore = transaction.objectStore('clearanceOS');
let clearanceRequestId
Expand Down

0 comments on commit 9383d8e

Please sign in to comment.