-
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.
moved delete station in to helper folder
- Loading branch information
nikiwycherley
committed
May 8, 2024
1 parent
cbfab1f
commit a8187ab
Showing
3 changed files
with
17 additions
and
12 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const logger = require('./logging') | ||
const pg = require('./db') | ||
|
||
async function deleteStation (stationId) { | ||
try { | ||
await pg('station_display_time_series').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 | ||
} | ||
} | ||
|
||
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