Skip to content

Commit

Permalink
asasasas
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurgolo committed Mar 2, 2024
1 parent 998241b commit 10d1a23
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion pages/teamdetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async function submitTeamData( teamname, globalid, teamnumber, teamschool, allia

document.getElementById("teaminfoform").addEventListener("submit", function(event) {
event.preventDefault(); // Prevent default form submission behavior

const teamname = document.getElementById('teamname').value;
const teamnumber = document.getElementById('teamnumber').value;
const teamschool = document.getElementById('teamschool').value;
Expand Down Expand Up @@ -165,3 +165,23 @@ document.getElementById("teaminfoform").addEventListener("submit", function(even
submitTeamData( teamname, globalid, teamnumber, teamschool, alliancescore, moreinfo, startingpos, Leaveszone, scores1amp, scores1speaker, picksup, scores2amp, scores2speaker, preferredScoringMethod, preferredIntakeMethod, prefintake, spotlight, trap, alone, hangsWithAnother, attemptsSpotlight, coop);

});

// Assuming db is your Dexie database instance
const db = new Dexie("Team Tracking App");
db.version(1).stores({
teams: "++id,teamname,globalid,teamnumber,teamschool,alliancescore" // Define your schema as per your setup
});

// Function to print all teams to the console
async function printTeams() {
try {
// Use Dexie's toArray() to get all records from the teams table
const allTeams = await db.teams.toArray();
console.log("Teams:", allTeams);
} catch (error) {
console.error("Failed to print teams:", error);
}
}

// Call the function to print teams
printTeams();

0 comments on commit 10d1a23

Please sign in to comment.