Add function to remove teams
parent
7e07236779
commit
16c90cf883
|
@ -28,3 +28,11 @@ async function rename(id, name) {
|
|||
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