Add function to remove teams

main
sudoer777 2021-11-20 21:39:30 -07:00
parent 7e07236779
commit 16c90cf883
1 changed files with 8 additions and 0 deletions

View File

@ -27,4 +27,12 @@ async function rename(id, name) {
WHERE team_id = $1;`; WHERE team_id = $1;`;
await database.executeQuery(query, [id, name]); await database.executeQuery(query, [id, name]);
return new Team(id, name); return new Team(id, name);
}
async function remove(id) {
query = `DELETE FROM scores.teams
WHERE team_id = $1
RETURNING team_name;`;
name = (await database.executeQuery(query, [id]))[0][0];
return new Team(id, name);
} }