Add function to remove season
parent
b533668445
commit
e9bda3c807
|
@ -19,4 +19,12 @@ async function create(year) {
|
|||
RETURNING season_id;`;
|
||||
const id = (await database.executeQuery(query, [year]))[0][0];
|
||||
return new Season(id, year);
|
||||
}
|
||||
|
||||
async function remove(id) {
|
||||
const query = `DELETE FROM scores.seasons
|
||||
WHERE season_id = $1
|
||||
RETURNING school_year;`;
|
||||
const year = (await database.executeQuery(query, [id]))[0][0];
|
||||
return new Season(id, year);
|
||||
}
|
Reference in New Issue