sunrise-cms/handlers/admin-post/doDeleteLotOccupantType.ts

25 lines
560 B
TypeScript

import type { Request, Response } from 'express'
import { deleteRecord } from '../../database/deleteRecord.js'
import { getLotOccupantTypes } from '../../helpers/functions.cache.js'
export async function handler(
request: Request,
response: Response
): Promise<void> {
const success = await deleteRecord(
'LotOccupantTypes',
request.body.lotOccupantTypeId as string,
request.session.user as User
)
const lotOccupantTypes = await getLotOccupantTypes()
response.json({
success,
lotOccupantTypes
})
}
export default handler