Remove error message display
This commit is contained in:
parent
efa342dc7f
commit
5d12cb64e4
3 changed files with 3 additions and 10 deletions
|
@ -1,8 +1,3 @@
|
||||||
function displayErrorMessage(errorMessage) {
|
|
||||||
const errorReport = document.querySelector("#errorReport");
|
|
||||||
errorReport.innerHTML = JSON.parse(errorMessage).error;
|
|
||||||
}
|
|
||||||
|
|
||||||
function postToLoginEndpoint(event) {
|
function postToLoginEndpoint(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
@ -30,7 +25,6 @@ function postToLoginEndpoint(event) {
|
||||||
console.error("LOGIN FAILURE!");
|
console.error("LOGIN FAILURE!");
|
||||||
console.error("Server status: " + this.status);
|
console.error("Server status: " + this.status);
|
||||||
console.error("Server response:\n" + this.response);
|
console.error("Server response:\n" + this.response);
|
||||||
displayErrorMessage(this.response);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -224,7 +224,7 @@ function displayListOfReports(parsedData) {
|
||||||
for (let i = 0; i < reports.length; i++) {
|
for (let i = 0; i < reports.length; i++) {
|
||||||
let title = reports[i].title;
|
let title = reports[i].title;
|
||||||
let dateCreated = new Date(reports[i].date_created).toLocaleDateString("en-US");
|
let dateCreated = new Date(reports[i].date_created).toLocaleDateString("en-US");
|
||||||
let submitted = reports[i].submitted;
|
let state = reports[i].submitted;
|
||||||
let dateSubmitted;
|
let dateSubmitted;
|
||||||
let rid = reports[i].report_pk;
|
let rid = reports[i].report_pk;
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ function displayListOfReports(parsedData) {
|
||||||
bodyRow.insertCell(1).innerHTML = dateCreated;
|
bodyRow.insertCell(1).innerHTML = dateCreated;
|
||||||
|
|
||||||
let stateCell = bodyRow.insertCell(2);
|
let stateCell = bodyRow.insertCell(2);
|
||||||
stateCell.innerHTML = submitted;
|
stateCell.innerHTML = state;
|
||||||
stateCell.classList.add("d-none", "d-lg-table-cell"); // Column visible only on large displays
|
stateCell.classList.add("d-none", "d-lg-table-cell"); // Column visible only on large displays
|
||||||
|
|
||||||
// Create edit/view button
|
// Create edit/view button
|
||||||
|
@ -242,7 +242,7 @@ function displayListOfReports(parsedData) {
|
||||||
actionButton.setAttribute("data-rid", rid);
|
actionButton.setAttribute("data-rid", rid);
|
||||||
actionButton.classList.add("btn");
|
actionButton.classList.add("btn");
|
||||||
|
|
||||||
if (submitted === false) {
|
if (state === false) {
|
||||||
// Edit button
|
// Edit button
|
||||||
dateSubmitted = "TBD";
|
dateSubmitted = "TBD";
|
||||||
actionButton.classList.add("btn-primary", "edit-report-button"); // Add event listener class
|
actionButton.classList.add("btn-primary", "edit-report-button"); // Add event listener class
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p id="errorReport"><p>
|
|
||||||
<script src="js/login.js"></script>
|
<script src="js/login.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue