Add function to remove teams
parent
7e07236779
commit
16c90cf883
|
@ -27,4 +27,12 @@ async function rename(id, name) {
|
|||
WHERE team_id = $1;`;
|
||||
await database.executeQuery(query, [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);
|
||||
}
|
Reference in New Issue