Add function to remove season
parent
b533668445
commit
e9bda3c807
|
@ -20,3 +20,11 @@ async function create(year) {
|
|||
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