24 lines
590 B
TypeScript
24 lines
590 B
TypeScript
import type { RequestHandler } from 'express'
|
|
|
|
import {
|
|
moveRecordDown,
|
|
moveRecordDownToBottom
|
|
} from '../../helpers/lotOccupancyDB/moveRecord.js'
|
|
import { getLotStatuses } from '../../helpers/functions.cache.js'
|
|
|
|
export const handler: RequestHandler = (request, response) => {
|
|
const success =
|
|
request.body.moveToEnd === '1'
|
|
? moveRecordDownToBottom('LotStatuses', request.body.lotStatusId)
|
|
: moveRecordDown('LotStatuses', request.body.lotStatusId)
|
|
|
|
const lotStatuses = getLotStatuses()
|
|
|
|
response.json({
|
|
success,
|
|
lotStatuses
|
|
})
|
|
}
|
|
|
|
export default handler
|