25 lines
592 B
TypeScript
25 lines
592 B
TypeScript
import type { RequestHandler } from 'express'
|
|
|
|
import { deleteRecord } from '../../helpers/lotOccupancyDB/deleteRecord.js'
|
|
|
|
import { getLotOccupancyComments } from '../../helpers/lotOccupancyDB/getLotOccupancyComments.js'
|
|
|
|
export const handler: RequestHandler = (request, response) => {
|
|
const success = deleteRecord(
|
|
'LotOccupancyComments',
|
|
request.body.lotOccupancyCommentId,
|
|
request.session
|
|
)
|
|
|
|
const lotOccupancyComments = getLotOccupancyComments(
|
|
request.body.lotOccupancyId
|
|
)
|
|
|
|
response.json({
|
|
success,
|
|
lotOccupancyComments
|
|
})
|
|
}
|
|
|
|
export default handler
|