Add functionality to list teams on manage page

main
sudoer777 2021-11-22 15:48:30 -07:00
parent 90ef696b71
commit 6fdbaedc79
1 changed files with 39 additions and 0 deletions

View File

@ -125,6 +125,45 @@ CATEGORIES.push(new Category(
}
));
CATEGORIES.push(new Category(
"teams",
async function getTeams() {
return await Data.getTeams();
},
async function listTeamHeaders() {
const headerRow = document.createElement('tr');
const nameHeader = document.createElement('th');
nameHeader.textContent = "Name";
headerRow.appendChild(nameHeader);
const sportHeader = document.createElement('th');
sportHeader.textContent = "Sport";
headerRow.appendChild(sportHeader);
itemsListTable.appendChild(headerRow);
},
function listTeam(team, row) {
const nameCell = document.createElement('td');
nameCell.textContent = team.name;
row.appendChild(nameCell);
const sportCell = document.createElement('td');
Data.getSportName(team.sportID)
.then(data => sportCell.textContent = data);
row.appendChild(sportCell);
},
async function addSeason() {
//
},
async function submitSeason() {
//
},
async function editSeason() {
}
));
async function listItems(category) {