cityssm/parking-ticket-system

View on GitHub
handlers/plates-post/doAddLicencePlateToLookupBatch.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { addLicencePlateToLookupBatch } from '../../database/parkingDB/addLicencePlateToLookupBatch.js';
import getLookupBatch from '../../database/parkingDB/getLookupBatch.js';
export default function handler(request, response) {
    const result = addLicencePlateToLookupBatch(request.body, request.session.user);
    if (result.success) {
        result.batch = getLookupBatch(Number.parseInt(request.body.batchId, 10));
    }
    response.json(result);
}