-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nikiwycherley
committed
May 8, 2024
1 parent
8f36696
commit 183fe4b
Showing
3 changed files
with
5 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
const logger = require('./logging') | ||
const pg = require('./db') | ||
|
||
async function deleteStation (stationId, tableName) { | ||
try { | ||
await pg(tableName).where({ station_id: stationId }).delete() | ||
logger.info(`Deleted data for RLOI id ${stationId}`) | ||
} catch (error) { | ||
logger.error(`Error deleting data for station ${stationId}`, error) | ||
throw error | ||
} | ||
await pg(tableName).where({ station_id: stationId }).delete() | ||
} | ||
|
||
module.exports = { deleteStation } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters