Add function to rename teams
parent
9c55999ad8
commit
7e07236779
|
@ -19,4 +19,12 @@ async function create(name, sportID) {
|
|||
RETURNING team_id;`;
|
||||
const id = (await database.executeQuery(query, [name, sportID]))[0][0];
|
||||
return new Team(id, name);
|
||||
}
|
||||
|
||||
async function rename(id, name) {
|
||||
query = `UPDATE scores.teams
|
||||
SET team_name = $2
|
||||
WHERE team_id = $1;`;
|
||||
await database.executeQuery(query, [id, name]);
|
||||
return new Team(id, name);
|
||||
}
|
Reference in New Issue