23 lines
452 B
TypeScript
23 lines
452 B
TypeScript
import type { Request, Response } from 'express'
|
|
|
|
import addLotOccupancy, {
|
|
type AddLotOccupancyForm
|
|
} from '../../database/addLotOccupancy.js'
|
|
|
|
export async function handler(
|
|
request: Request,
|
|
response: Response
|
|
): Promise<void> {
|
|
const lotOccupancyId = await addLotOccupancy(
|
|
request.body as AddLotOccupancyForm,
|
|
request.session.user as User
|
|
)
|
|
|
|
response.json({
|
|
success: true,
|
|
lotOccupancyId
|
|
})
|
|
}
|
|
|
|
export default handler
|