import type { Request, Response } from 'express' import { moveRecordUp, moveRecordUpToTop } from '../../database/moveRecord.js' import { getLotOccupantTypes } from '../../helpers/functions.cache.js' export default async function handler( request: Request, response: Response ): Promise { const success = request.body.moveToEnd === '1' ? await moveRecordUpToTop('LotOccupantTypes', request.body.lotOccupantTypeId) : await moveRecordUp('LotOccupantTypes', request.body.lotOccupantTypeId) const lotOccupantTypes = await getLotOccupantTypes() response.json({ success, lotOccupantTypes }) }