-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ensure printed conviction batches can't be updated
- Loading branch information
Showing
8 changed files
with
679 additions
and
585 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import type { RequestHandler } from 'express'; | ||
export declare const handler: RequestHandler; | ||
export default handler; |
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,12 @@ | ||
import { getConvictionBatch } from '../../database/parkingDB/getConvictionBatch.js'; | ||
import { markConvictionBatchAsSent } from '../../database/parkingDB/markConvictionBatchAsSent.js'; | ||
export const handler = (request, response) => { | ||
const batchID = request.body.batchID; | ||
const success = markConvictionBatchAsSent(batchID, request.session.user); | ||
const batch = getConvictionBatch(batchID); | ||
response.json({ | ||
success, | ||
batch | ||
}); | ||
}; | ||
export default handler; |
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,22 @@ | ||
import type { RequestHandler } from 'express' | ||
|
||
import { getConvictionBatch } from '../../database/parkingDB/getConvictionBatch.js' | ||
import { markConvictionBatchAsSent } from '../../database/parkingDB/markConvictionBatchAsSent.js' | ||
|
||
export const handler: RequestHandler = (request, response) => { | ||
const batchID = request.body.batchID | ||
|
||
const success = markConvictionBatchAsSent( | ||
batchID, | ||
request.session.user as PTSUser | ||
) | ||
|
||
const batch = getConvictionBatch(batchID) | ||
|
||
response.json({ | ||
success, | ||
batch | ||
}) | ||
} | ||
|
||
export default handler |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.