Add function to rename teams
parent
9c55999ad8
commit
7e07236779
|
@ -20,3 +20,11 @@ async function create(name, sportID) {
|
|||
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