import { moveRecordUp, moveRecordUpToTop } from '../../helpers/lotOccupancyDB/moveRecord.js'; import { getLotOccupantTypes } from '../../helpers/functions.cache.js'; export async function handler(request, response) { 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 }); } export default handler;