Skip to content

Commit

Permalink
ensure printed conviction batches can't be updated
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Nov 7, 2023
1 parent 1a3afd9 commit c3a544b
Show file tree
Hide file tree
Showing 8 changed files with 679 additions and 585 deletions.
3 changes: 3 additions & 0 deletions handlers/tickets-post/doMarkConvictionBatchSent.d.ts
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;
12 changes: 12 additions & 0 deletions handlers/tickets-post/doMarkConvictionBatchSent.js
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;
22 changes: 22 additions & 0 deletions handlers/tickets-post/doMarkConvictionBatchSent.ts
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
420 changes: 215 additions & 205 deletions public-typescript/mto-ticketConvict.js

Large diffs are not rendered by default.

Loading

0 comments on commit c3a544b

Please sign in to comment.