Fix empty report table message
This commit is contained in:
parent
8da8e55279
commit
13ba704824
1 changed files with 5 additions and 4 deletions
|
@ -290,14 +290,15 @@ function createReportForm(parsedData, type) {
|
||||||
|
|
||||||
function displayListOfReports(parsedData) {
|
function displayListOfReports(parsedData) {
|
||||||
const reports = parsedData.reports;
|
const reports = parsedData.reports;
|
||||||
|
const table = document.querySelector("table");
|
||||||
|
|
||||||
if (reports.length === 0) {
|
if (reports.length === 0) {
|
||||||
const cardBody = document.querySelector(".card-body");
|
const cardBody = document.querySelector(".card-body");
|
||||||
const p = document.createElement("p");
|
const h4 = document.createElement("h4");
|
||||||
p.innerHTML = "No reports found.";
|
h4.innerHTML = "No reports found.";
|
||||||
cardBody.appendChild(p);
|
h4.classList.add("text-center");
|
||||||
|
cardBody.insertBefore(h4, table);
|
||||||
} else {
|
} else {
|
||||||
const table = document.querySelector("table");
|
|
||||||
const tbody = document.querySelector("tbody");
|
const tbody = document.querySelector("tbody");
|
||||||
|
|
||||||
// Insert data into the table row
|
// Insert data into the table row
|
||||||
|
|
Loading…
Reference in a new issue